diff options
| author | bors <bors@rust-lang.org> | 2016-08-20 07:09:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-20 07:09:53 -0700 |
| commit | 490189634b656dcca9e41e6b52093569c03bd4df (patch) | |
| tree | e437ade751764c2f56a3c9c3be904b815ad27031 /src/libstd | |
| parent | 99867ee88380062827b63ce547603eea5fd3136c (diff) | |
| parent | 9072861c2044b85c3bb8503487d5772297053cf8 (diff) | |
| download | rust-490189634b656dcca9e41e6b52093569c03bd4df.tar.gz rust-490189634b656dcca9e41e6b52093569c03bd4df.zip | |
Auto merge of #35857 - jonathandturner:rollup, r=jonathandturner
Rollup of 19 pull requests - Successful merges: #35234, #35701, #35709, #35710, #35775, #35778, #35780, #35781, #35794, #35800, #35804, #35806, #35811, #35812, #35818, #35827, #35830, #35831, #35839 - Failed merges: #35759
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/os_str.rs | 32 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/primitive_docs.rs | 2 |
4 files changed, 37 insertions, 5 deletions
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 0d29e62485a..3d23a9a2383 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -251,6 +251,14 @@ impl Hash for OsString { impl OsStr { /// Coerces into an `OsStr` slice. + /// + /// # Examples + /// + /// ``` + /// use std::ffi::OsStr; + /// + /// let os_str = OsStr::new("foo"); + /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr { s.as_ref() @@ -283,6 +291,18 @@ impl OsStr { } /// Checks whether the `OsStr` is empty. + /// + /// # Examples + /// + /// ``` + /// use std::ffi::OsStr; + /// + /// let os_str = OsStr::new(""); + /// assert!(os_str.is_empty()); + /// + /// let os_str = OsStr::new("foo"); + /// assert!(!os_str.is_empty()); + /// ``` #[stable(feature = "osstring_simple_functions", since = "1.9.0")] pub fn is_empty(&self) -> bool { self.inner.inner.is_empty() @@ -296,6 +316,18 @@ impl OsStr { /// other methods like `OsString::with_capacity` to avoid reallocations. /// /// See `OsStr` introduction for more information about encoding. + /// + /// # Examples + /// + /// ``` + /// use std::ffi::OsStr; + /// + /// let os_str = OsStr::new(""); + /// assert_eq!(os_str.len(), 0); + /// + /// let os_str = OsStr::new("foo"); + /// assert_eq!(os_str.len(), 3); + /// ``` #[stable(feature = "osstring_simple_functions", since = "1.9.0")] pub fn len(&self) -> usize { self.inner.inner.len() diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 88fd4186e0a..307d014fd68 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -236,7 +236,7 @@ //! to read the line and print it, so we use `()`. //! //! [result]: type.Result.html -//! [try]: ../macro.try!.html +//! [try]: ../macro.try.html //! //! ## Platform-specific behavior //! @@ -957,8 +957,8 @@ pub trait Write { /// explicitly be called. The [`write!`][write] macro should be favored to /// invoke this method instead. /// - /// [formatargs]: ../macro.format_args!.html - /// [write]: ../macro.write!.html + /// [formatargs]: ../macro.format_args.html + /// [write]: ../macro.write.html /// /// This function internally uses the [`write_all`][writeall] method on /// this trait and hence will continuously write data so long as no errors diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index c05e0c3ca68..ff3b9c6d041 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -175,7 +175,7 @@ //! [`atomic`]: sync/atomic/index.html //! [`collections`]: collections/index.html //! [`for`]: ../book/loops.html#for -//! [`format!`]: macro.format!.html +//! [`format!`]: macro.format.html //! [`fs`]: fs/index.html //! [`io`]: io/index.html //! [`iter`]: iter/index.html diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index d31a5930376..2b92da6c684 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -27,7 +27,7 @@ /// assert!(!bool_val); /// ``` /// -/// [`assert!`]: macro.assert!.html +/// [`assert!`]: macro.assert.html /// [`if`]: ../book/if.html /// [`BitAnd`]: ops/trait.BitAnd.html /// [`BitOr`]: ops/trait.BitOr.html |
