diff options
| author | Ivan Tham <pickfire@riseup.net> | 2020-04-13 22:25:15 +0800 |
|---|---|---|
| committer | Ivan Tham <pickfire@riseup.net> | 2020-04-13 22:25:15 +0800 |
| commit | 7a22cf6415b75388448156708c07dd6cf5eb116a (patch) | |
| tree | e7099637e862176f389dbcc7d5569a4d1e135c4f /src/liballoc/string.rs | |
| parent | cbe96b04ad9a7109febac47e660d993b45542c1f (diff) | |
| download | rust-7a22cf6415b75388448156708c07dd6cf5eb116a.tar.gz rust-7a22cf6415b75388448156708c07dd6cf5eb116a.zip | |
Add examples to Pattern docs
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index cc628fe0f0c..86e09b7be2d 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1828,6 +1828,12 @@ impl<'a> Extend<Cow<'a, str>> for String { } /// 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", |
