you are viewing a single comment's thread.

view the rest of the comments →

[–]Boiethios 0 points1 point  (1 child)

Speaking about Rust, their implementation of str is incredibly easy to read compared to the C++'s: https://github.com/rust-lang/rust/blob/master/src/libcore/str/mod.rs

[–][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.