about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-09-27 00:43:32 +0200
committerGitHub <noreply@github.com>2024-09-27 00:43:32 +0200
commite65054633c64e82a0f88fded06e81bb5b8678275 (patch)
tree5413af10ee7da2278b9de63ed708f241d0fb93f5
parentd3cb1ce0a0d3a2dd9882a3f6028af21c169ab67f (diff)
parent8f1ed9b2e2930ded9c273fec566131519205a866 (diff)
downloadrust-e65054633c64e82a0f88fded06e81bb5b8678275.tar.gz
rust-e65054633c64e82a0f88fded06e81bb5b8678275.zip
Rollup merge of #130845 - RalfJung:utf8chunk, r=tgross35
Utf8Chunks: add link to Utf8Chunk

It is currently surprisingly non-trivial to go from the `utf8_chunks` method to the docs of the `valid`/`invalid` methods used in the example. This should help.
-rw-r--r--library/core/src/str/lossy.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/str/lossy.rs b/library/core/src/str/lossy.rs
index 3f31107acf0..e7677c8317a 100644
--- a/library/core/src/str/lossy.rs
+++ b/library/core/src/str/lossy.rs
@@ -8,6 +8,8 @@ impl [u8] {
     /// Creates an iterator over the contiguous valid UTF-8 ranges of this
     /// slice, and the non-UTF-8 fragments in between.
     ///
+    /// See the [`Utf8Chunk`] type for documenation of the items yielded by this iterator.
+    ///
     /// # Examples
     ///
     /// This function formats arbitrary but mostly-UTF-8 bytes into Rust source
@@ -148,6 +150,8 @@ impl fmt::Debug for Debug<'_> {
 /// If you want a simple conversion from UTF-8 byte slices to string slices,
 /// [`from_utf8`] is easier to use.
 ///
+/// See the [`Utf8Chunk`] type for documenation of the items yielded by this iterator.
+///
 /// [byteslice]: slice
 /// [`from_utf8`]: super::from_utf8
 ///