Skip to content

Commit d896a0c

Browse files
committed
Add more references between lowercase/uppercase operations.
1 parent f5d1128 commit d896a0c

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/libstd/ascii.rs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ pub trait AsciiExt {
6666
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
6767
/// but non-ASCII letters are unchanged.
6868
///
69+
/// To uppercase the string in-place, use [`make_ascii_uppercase`].
70+
///
71+
/// To uppercase ASCII characters in addition to non-ASCII characters, use
72+
/// [`str::to_uppercase`].
73+
///
6974
/// # Examples
7075
///
7176
/// ```
@@ -77,6 +82,9 @@ pub trait AsciiExt {
7782
/// assert_eq!('A', ascii.to_ascii_uppercase());
7883
/// assert_eq!('❤', utf8.to_ascii_uppercase());
7984
/// ```
85+
///
86+
/// [`make_ascii_uppercase`]: #tymethod.make_ascii_uppercase
87+
/// [`str::to_uppercase`]: ../primitive.str.html#method.to_uppercase
8088
#[stable(feature = "rust1", since = "1.0.0")]
8189
fn to_ascii_uppercase(&self) -> Self::Owned;
8290

@@ -85,6 +93,11 @@ pub trait AsciiExt {
8593
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
8694
/// but non-ASCII letters are unchanged.
8795
///
96+
/// To lowercase the string in-place, use [`make_ascii_lowercase`].
97+
///
98+
/// To lowercase ASCII characters in addition to non-ASCII characters, use
99+
/// [`str::to_lowercase`].
100+
///
88101
/// # Examples
89102
///
90103
/// ```
@@ -96,6 +109,9 @@ pub trait AsciiExt {
96109
/// assert_eq!('a', ascii.to_ascii_lowercase());
97110
/// assert_eq!('❤', utf8.to_ascii_lowercase());
98111
/// ```
112+
///
113+
/// [`make_ascii_lowercase`]: #tymethod.make_ascii_lowercase
114+
/// [`str::to_lowercase`]: ../primitive.str.html#method.to_lowercase
99115
#[stable(feature = "rust1", since = "1.0.0")]
100116
fn to_ascii_lowercase(&self) -> Self::Owned;
101117

@@ -123,7 +139,11 @@ pub trait AsciiExt {
123139

124140
/// Converts this type to its ASCII upper case equivalent in-place.
125141
///
126-
/// See `to_ascii_uppercase` for more information.
142+
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
143+
/// but non-ASCII letters are unchanged.
144+
///
145+
/// To return a new uppercased string without modifying the existing one, use
146+
/// [`to_ascii_uppercase`].
127147
///
128148
/// # Examples
129149
///
@@ -136,12 +156,18 @@ pub trait AsciiExt {
136156
///
137157
/// assert_eq!('A', ascii);
138158
/// ```
159+
///
160+
/// [`to_ascii_uppercase`]: #tymethod.to_ascii_uppercase
139161
#[stable(feature = "ascii", since = "1.9.0")]
140162
fn make_ascii_uppercase(&mut self);
141163

142164
/// Converts this type to its ASCII lower case equivalent in-place.
143165
///
144-
/// See `to_ascii_lowercase` for more information.
166+
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
167+
/// but non-ASCII letters are unchanged.
168+
///
169+
/// To return a new lowercased string without modifying the existing one, use
170+
/// [`to_ascii_lowercase`].
145171
///
146172
/// # Examples
147173
///
@@ -154,6 +180,8 @@ pub trait AsciiExt {
154180
///
155181
/// assert_eq!('a', ascii);
156182
/// ```
183+
///
184+
/// [`to_ascii_lowercase`]: #tymethod.to_ascii_lowercase
157185
#[stable(feature = "ascii", since = "1.9.0")]
158186
fn make_ascii_lowercase(&mut self);
159187
}

0 commit comments

Comments
 (0)