diff options
Diffstat (limited to 'library/core/src/result.rs')
-rw-r--r-- | library/core/src/result.rs | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/library/core/src/result.rs b/library/core/src/result.rs index f00c40f35..208b220c2 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -458,7 +458,7 @@ //! [`Result`] of a collection of each contained value of the original //! [`Result`] values, or [`Err`] if any of the elements was [`Err`]. //! -//! [impl-FromIterator]: Result#impl-FromIterator%3CResult%3CA%2C%20E%3E%3E-for-Result%3CV%2C%20E%3E +//! [impl-FromIterator]: Result#impl-FromIterator%3CResult%3CA,+E%3E%3E-for-Result%3CV,+E%3E //! //! ``` //! let v = [Ok(2), Ok(4), Err("err!"), Ok(8)]; @@ -474,8 +474,8 @@ //! to provide the [`product`][Iterator::product] and //! [`sum`][Iterator::sum] methods. //! -//! [impl-Product]: Result#impl-Product%3CResult%3CU%2C%20E%3E%3E-for-Result%3CT%2C%20E%3E -//! [impl-Sum]: Result#impl-Sum%3CResult%3CU%2C%20E%3E%3E-for-Result%3CT%2C%20E%3E +//! [impl-Product]: Result#impl-Product%3CResult%3CU,+E%3E%3E-for-Result%3CT,+E%3E +//! [impl-Sum]: Result#impl-Sum%3CResult%3CU,+E%3E%3E-for-Result%3CT,+E%3E //! //! ``` //! let v = [Err("error!"), Ok(1), Ok(2), Ok(3), Err("foo")]; @@ -525,8 +525,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<i32, &str> = Ok(-3); /// assert_eq!(x.is_ok(), true); @@ -572,8 +570,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<i32, &str> = Ok(-3); /// assert_eq!(x.is_err(), false); @@ -627,8 +623,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(2); /// assert_eq!(x.ok(), Some(2)); @@ -658,8 +652,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(2); /// assert_eq!(x.err(), None); @@ -693,8 +685,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(2); /// assert_eq!(x.as_ref(), Ok(&2)); @@ -716,8 +706,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn mutate(r: &mut Result<i32, i32>) { /// match r.as_mut() { @@ -812,8 +800,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let k = 21; /// @@ -841,8 +827,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn stringify(x: u32) -> String { format!("error code: {x}") } /// @@ -968,8 +952,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(7); /// assert_eq!(x.iter().next(), Some(&7)); @@ -989,8 +971,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let mut x: Result<u32, &str> = Ok(7); /// match x.iter_mut().next() { @@ -1031,8 +1011,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ```should_panic /// let x: Result<u32, &str> = Err("emergency failure"); /// x.expect("Testing expect"); // panics with `Testing expect: emergency failure` @@ -1160,8 +1138,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ```should_panic /// let x: Result<u32, &str> = Ok(10); /// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10` @@ -1222,8 +1198,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] @@ -1259,8 +1233,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] @@ -1298,8 +1270,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(2); /// let y: Result<&str, &str> = Err("late error"); @@ -1383,8 +1353,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(2); /// let y: Result<u32, &str> = Err("late error"); @@ -1426,8 +1394,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) } /// fn err(x: u32) -> Result<u32, u32> { Err(x) } @@ -1456,8 +1422,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let default = 2; /// let x: Result<u32, &str> = Ok(9); @@ -1487,8 +1451,6 @@ impl<T, E> Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn count(x: &str) -> usize { x.len() } /// @@ -1752,8 +1714,6 @@ impl<T, E> Result<Result<T, E>, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// #![feature(result_flattening)] /// let x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello")); @@ -1842,8 +1802,6 @@ impl<T, E> IntoIterator for Result<T, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result<u32, &str> = Ok(5); /// let v: Vec<u32> = x.into_iter().collect(); |