Skip to content

Commit

Permalink
Rollup merge of #108130 - tshepang:just-one-example, r=workingjubilee
Browse files Browse the repository at this point in the history
"Basic usage" is redundant for there is just one example
  • Loading branch information
Dylan-DPC authored Feb 19, 2023
2 parents 4a0f088 + 6da6437 commit 0257e28
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand All @@ -716,8 +706,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// fn mutate(r: &mut Result<i32, i32>) {
/// match r.as_mut() {
Expand Down Expand Up @@ -812,8 +800,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let k = 21;
///
Expand Down Expand Up @@ -841,8 +827,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// fn stringify(x: u32) -> String { format!("error code: {x}") }
///
Expand Down Expand Up @@ -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));
Expand All @@ -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() {
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -1222,8 +1198,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # #![feature(never_type)]
/// # #![feature(unwrap_infallible)]
Expand Down Expand Up @@ -1259,8 +1233,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # #![feature(never_type)]
/// # #![feature(unwrap_infallible)]
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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) }
Expand Down Expand Up @@ -1456,8 +1422,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let default = 2;
/// let x: Result<u32, &str> = Ok(9);
Expand Down Expand Up @@ -1487,8 +1451,6 @@ impl<T, E> Result<T, E> {
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// fn count(x: &str) -> usize { x.len() }
///
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 0257e28

Please sign in to comment.