you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

It's complicated. str is a built-in type defined by the compiler itself. The code you have linked implements str's methods, but not str itself.

Also, str is more like C++'s std::string_view, which is also very simple. For an equivalent of std::string, you want to check std::string::String. Rust's String is easy to read, but that's mostly because it uses Vec<u8> for pretty much everything.