stack_string/stack_string.rs
1use stack_collections::StackString;
2
3fn main() {
4 let mut s = StackString::<32>::new();
5 s.push_str("Hello, ");
6 s.push_str("world!");
7
8 println!("String: {}", s);
9 println!("Length: {}", s.len());
10 println!("Capacity: {}", s.capacity());
11
12 // Pop characters
13 while let Some(c) = s.try_pop() {
14 println!("Popped: {}", c);
15 }
16}