What's the best way to implement a string buffer in Rust?
Use the String native type, it's designed to be mutable and grow easily.
let mut s = String::new();
s.push_str("GET / HTTP/1.0\r\n");
s.push_str("User-Agent: foobar\r\n"); // Etc etc
Use the String native type, it's designed to be mutable and grow easily.
let mut s = String::new();
s.push_str("GET / HTTP/1.0\r\n");
s.push_str("User-Agent: foobar\r\n"); // Etc etc