Skip to content

Commit

Permalink
fix(str.md): avoid misunderstanding that there were only two string t…
Browse files Browse the repository at this point in the history
…ypes

With the previous wording, some might think there are exactly two string types in Rust. Even in the standard library you find more string types than `String` and `&str`, like CStr, OsStr or Path. It is also possible to define your own string types, so theoretically there is an infinite amount of string types in Rust.
  • Loading branch information
AndreasHuber authored Jan 20, 2024
1 parent ddf5cb0 commit d5f0758
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/std/str.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Strings

There are two types of strings in Rust: `String` and `&str`.
The two most used string types in Rust are `String` and `&str`.

A `String` is stored as a vector of bytes (`Vec<u8>`), but guaranteed to
always be a valid UTF-8 sequence. `String` is heap allocated, growable and not
Expand Down

0 comments on commit d5f0758

Please sign in to comment.