From 6da64379ab1ed85a186011445edf22703bb7eb8f Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Thu, 16 Feb 2023 19:49:31 +0200 Subject: [PATCH] "Basic usage" is redundant for there is just one example --- library/core/src/result.rs | 42 -------------------------------------- 1 file changed, 42 deletions(-) diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 7596e9cc005..208b220c24a 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -525,8 +525,6 @@ impl Result { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(-3); /// assert_eq!(x.is_ok(), true); @@ -572,8 +570,6 @@ pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(-3); /// assert_eq!(x.is_err(), false); @@ -627,8 +623,6 @@ pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(2); /// assert_eq!(x.ok(), Some(2)); @@ -658,8 +652,6 @@ pub const fn ok(self) -> Option /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(2); /// assert_eq!(x.err(), None); @@ -693,8 +685,6 @@ pub const fn err(self) -> Option /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(2); /// assert_eq!(x.as_ref(), Ok(&2)); @@ -716,8 +706,6 @@ pub const fn as_ref(&self) -> Result<&T, &E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn mutate(r: &mut Result) { /// match r.as_mut() { @@ -812,8 +800,6 @@ pub fn map_or U>(self, default: U, f: F) -> U { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let k = 21; /// @@ -841,8 +827,6 @@ pub fn map_or_else U, F: FnOnce(T) -> U>(self, default: D, f: /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn stringify(x: u32) -> String { format!("error code: {x}") } /// @@ -968,8 +952,6 @@ pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(7); /// assert_eq!(x.iter().next(), Some(&7)); @@ -989,8 +971,6 @@ pub fn iter(&self) -> Iter<'_, T> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let mut x: Result = Ok(7); /// match x.iter_mut().next() { @@ -1031,8 +1011,6 @@ pub fn iter_mut(&mut self) -> IterMut<'_, T> { /// /// # Examples /// - /// Basic usage: - /// /// ```should_panic /// let x: Result = Err("emergency failure"); /// x.expect("Testing expect"); // panics with `Testing expect: emergency failure` @@ -1160,8 +1138,6 @@ pub fn unwrap_or_default(self) -> T /// /// # Examples /// - /// Basic usage: - /// /// ```should_panic /// let x: Result = Ok(10); /// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10` @@ -1222,8 +1198,6 @@ pub fn unwrap_err(self) -> E /// /// # Examples /// - /// Basic usage: - /// /// ``` /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] @@ -1259,8 +1233,6 @@ pub fn into_ok(self) -> T /// /// # Examples /// - /// Basic usage: - /// /// ``` /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] @@ -1298,8 +1270,6 @@ pub fn into_err(self) -> E /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(2); /// let y: Result<&str, &str> = Err("late error"); @@ -1383,8 +1353,6 @@ pub fn and_then Result>(self, op: F) -> Result { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(2); /// let y: Result = Err("late error"); @@ -1426,8 +1394,6 @@ pub const fn or(self, res: Result) -> Result /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn sq(x: u32) -> Result { Ok(x * x) } /// fn err(x: u32) -> Result { Err(x) } @@ -1456,8 +1422,6 @@ pub fn or_else Result>(self, op: O) -> Result { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let default = 2; /// let x: Result = Ok(9); @@ -1487,8 +1451,6 @@ pub const fn unwrap_or(self, default: T) -> T /// /// # Examples /// - /// Basic usage: - /// /// ``` /// fn count(x: &str) -> usize { x.len() } /// @@ -1752,8 +1714,6 @@ impl Result, E> { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// #![feature(result_flattening)] /// let x: Result, u32> = Ok(Ok("hello")); @@ -1842,8 +1802,6 @@ impl IntoIterator for Result { /// /// # Examples /// - /// Basic usage: - /// /// ``` /// let x: Result = Ok(5); /// let v: Vec = x.into_iter().collect();