about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-13 20:23:32 +0200
committerGitHub <noreply@github.com>2020-04-13 20:23:32 +0200
commiteb49f7fd74b46f4646f0268c378b28a07433d4de (patch)
treede8e974183a871e29e55f9ef43b5083da980fcd5 /src/liballoc/string.rs
parentfd1b057004301be32a915ac8d924f7eb59ed1a9c (diff)
parent7a22cf6415b75388448156708c07dd6cf5eb116a (diff)
downloadrust-eb49f7fd74b46f4646f0268c378b28a07433d4de.tar.gz
rust-eb49f7fd74b46f4646f0268c378b28a07433d4de.zip
Rollup merge of #71097 - pickfire:pattern-docs, r=Dylan-DPC
Pattern docs

https://doc.rust-lang.org/std/str/pattern/trait.Pattern.html#implementors
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index 1e5fe125c55..86e09b7be2d 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -1827,7 +1827,13 @@ impl<'a> Extend<Cow<'a, str>> for String {
     }
 }
 
-/// A convenience impl that delegates to the impl for `&str`
+/// A convenience impl that delegates to the impl for `&str`.
+///
+/// # Examples
+///
+/// ```
+/// assert_eq!(String::from("Hello world").find("world"), Some(6));
+/// ```
 #[unstable(
     feature = "pattern",
     reason = "API not fully fleshed out and ready to be stabilized",