How do i create a mutable &str like variable?

What do i mean is , i have a variable in which i want to store name ( in english alphabets only ) and max is 10 characters , that means i want to create variable of &str type but want it to be mutable, The reason i don't want to choose String type is because it is heap allocated , but instead size is fixed so no need of heap allocated memory ,so i think it is possible to do it stack allocated memory so how do i achieve this?

Use the ArrayString type from the arrayvec crate.

1 Like

Thank You!

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.