From d5f0758abafe187733a79ef130d776b78e2ed580 Mon Sep 17 00:00:00 2001 From: AndreasHuber Date: Sat, 20 Jan 2024 14:35:11 +0100 Subject: [PATCH] fix(str.md): avoid misunderstanding that there were only two string types 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. --- src/std/str.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/std/str.md b/src/std/str.md index a15038b907..5e8e7aec4a 100644 --- a/src/std/str.md +++ b/src/std/str.md @@ -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`), but guaranteed to always be a valid UTF-8 sequence. `String` is heap allocated, growable and not