From 5ff1c383c5241f76e41648360a4435554b4cb4a4 Mon Sep 17 00:00:00 2001 From: Dodothereal <129273127+Dodothereal@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:39:20 +0200 Subject: [PATCH] docs(ch02): clarify String is heap-allocated Fixes #4758: the original phrasing 'a growable, UTF-8 encoded bit of text' is grammatically ambiguous: 'growable' is parsed as modifying 'bit of text', which can mislead learners into believing the value is mutable by default. Prepending 'heap-allocated' shifts the mental model to the container while keeping the substantive content the same. Pre-existing-comment-link targets retained. --- src/ch02-00-guessing-game-tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch02-00-guessing-game-tutorial.md b/src/ch02-00-guessing-game-tutorial.md index 3c590a1994..791d55b6ff 100644 --- a/src/ch02-00-guessing-game-tutorial.md +++ b/src/ch02-00-guessing-game-tutorial.md @@ -156,7 +156,7 @@ want to bind something to the variable now. On the right of the equal sign is the value that `guess` is bound to, which is the result of calling `String::new`, a function that returns a new instance of a `String`. [`String`][string] is a string type provided by the standard -library that is a growable, UTF-8 encoded bit of text. +library that is a heap-allocated, growable, UTF-8 encoded bit of text. The `::` syntax in the `::new` line indicates that `new` is an associated function of the `String` type. An _associated function_ is a function that’s