diff options
| author | Corey Farwell <coreyf@rwell.org> | 2018-08-11 14:09:59 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2018-08-11 15:42:35 -0400 |
| commit | ec18991492849393a8b3ae4e0c70a22319e8ea60 (patch) | |
| tree | 2917703d35382c3e6dcf5ca6e48b8aa0c2f50f0c /src/liballoc | |
| parent | 0aa8d0320266b5579428312095fe49af05ada972 (diff) | |
| download | rust-ec18991492849393a8b3ae4e0c70a22319e8ea60.tar.gz rust-ec18991492849393a8b3ae4e0c70a22319e8ea60.zip | |
Add links to std::char::REPLACEMENT_CHARACTER from docs.
There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/string.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 631779a17a1..dd559df08cc 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -519,10 +519,11 @@ impl String { /// between the two. Not all byte slices are valid strings, however: strings /// are required to be valid UTF-8. During this conversion, /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with - /// `U+FFFD REPLACEMENT CHARACTER`, which looks like this: � + /// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: � /// /// [`u8`]: ../../std/primitive.u8.html /// [byteslice]: ../../std/primitive.slice.html + /// [U+FFFD]: ../char/constant.REPLACEMENT_CHARACTER.html /// /// If you are sure that the byte slice is valid UTF-8, and you don't want /// to incur the overhead of the conversion, there is an unsafe version @@ -621,7 +622,7 @@ impl String { } /// Decode a UTF-16 encoded slice `v` into a `String`, replacing - /// invalid data with the replacement character (U+FFFD). + /// invalid data with [the replacement character (`U+FFFD`)][U+FFFD]. /// /// Unlike [`from_utf8_lossy`] which returns a [`Cow<'a, str>`], /// `from_utf16_lossy` returns a `String` since the UTF-16 to UTF-8 @@ -629,6 +630,7 @@ impl String { /// /// [`from_utf8_lossy`]: #method.from_utf8_lossy /// [`Cow<'a, str>`]: ../borrow/enum.Cow.html + /// [U+FFFD]: ../char/constant.REPLACEMENT_CHARACTER.html /// /// # Examples /// |
