How can i put a str in Box struct on mutable way (How does String works)

I wanna implement my own String struct to know how does it work :slight_smile:

Well, the std library doesn't use a box for strings. It uses a vec, like this:

pub struct String {
    vec: Vec<u8>,
}
3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.