docs(ch02): clarify String is heap-allocated (#4758)#4776
Open
Dodothereal wants to merge 1 commit into
Open
Conversation
Fixes rust-lang#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4758
Summary
The phrase 'a growable, UTF-8 encoded bit of text' in Chapter 2 is
grammatically ambiguous: 'growable' can be read as modifying 'bit of
text', which can mislead learners into thinking the value is mutable
by default. Adding 'heap-allocated' shifts the mental model to the
container while keeping the substantive content the same.
A one-word prepended qualifier is the minimum change that addresses
the issue's framing without rewriting the sentence structure.
Test plan
git diffreviewed: single-file, single-line change, no whitespace drift.issues that exist in upstream main on multiple files. The fixed
sentence is closer to dprint's expected layout than upstream; no
additional formatting was applied to avoid touching unrelated files.
AI assistance
Prepared with help from an AI coding assistant; reviewed end-to-end
before submission.