Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ impl char {
/// As an iterator:
///
/// ```
/// for c in 'ß'.to_uppercase() {
/// for c in ''.to_uppercase() {

@Noratrieb Noratrieb Jan 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would make sense to leave a comment explaining that this is a single codepoint? It might be a bit confusing otherwise, as people are likely to not know that these exist (I didn't)

/// print!("{c}");
/// }
/// println!();
Expand All @@ -1156,13 +1156,13 @@ impl char {
/// Using `println!` directly:
///
/// ```
/// println!("{}", 'ß'.to_uppercase());
/// println!("{}", ''.to_uppercase());
/// ```
///
/// Both are equivalent to:
///
/// ```
/// println!("SS");
/// println!("FFI");
/// ```
///
/// Using [`to_string`](../std/string/trait.ToString.html#tymethod.to_string):
Expand All @@ -1171,7 +1171,7 @@ impl char {
/// assert_eq!('c'.to_uppercase().to_string(), "C");
///
/// // Sometimes the result is more than one character:
/// assert_eq!('ß'.to_uppercase().to_string(), "SS");
/// assert_eq!(''.to_uppercase().to_string(), "FFI");
///
/// // Characters that do not have both uppercase and lowercase
/// // convert into themselves.
Expand Down
Loading