stackstring 0.4.4

A fixed-size string
Documentation
use stackstring::String;

fn main() {
    let s1 = String::<5>::try_from("abcde").unwrap();
    dbg!(s1); // just like a normal string

    // can be init from raw bytes
    let _s2 = String::<5>::from(*b"abcde");
    // or
    let s2 = String::<5>::from(b"abcde");
    dbg!(s2);

    let s3 = String::<5>::try_from_str_padded("abc").unwrap();
    assert_eq!(s3, "abc  ");

    let s4 = String::<6>::from_other(s3);
    assert_eq!(s4, "abc   ");

    // the opposite will result in a compile error, however
    // let s5 = String::<3>::from_other(s4);
}