diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/if_chain/src | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/if_chain/src')
-rw-r--r-- | vendor/if_chain/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/if_chain/src/lib.rs b/vendor/if_chain/src/lib.rs index e72f7aa88..dee02a9f0 100644 --- a/vendor/if_chain/src/lib.rs +++ b/vendor/if_chain/src/lib.rs @@ -100,7 +100,7 @@ //! ``` //! //! ## Type ascription -//! +//! //! ```rust,ignore //! let mut x = some_generic_computation(); //! if_chain! { @@ -110,9 +110,9 @@ //! else { x += 1 } //! } //! ``` -//! +//! //! becomes -//! +//! //! ```rust,ignore //! let mut x = some_generic_computation(); //! if x > 7 { @@ -122,7 +122,7 @@ //! x += 1 //! } //! ``` -//! +//! //! ## Multiple patterns //! //! ```rust,ignore @@ -193,7 +193,7 @@ macro_rules! __if_chain { // `let` with multiple patterns (@expand { $($other:tt)* } let $pat1:pat | $($pat:pat)|+ = $expr:expr; $($tt:tt)+) => { match $expr { - $pat1 | $($pat)|+ => __if_chain! { @expand { $($other)* } $($tt)+ } + $pat1 | $($pat)|+ => { __if_chain! { @expand { $($other)* } $($tt)+ } } } }; // `if let` with a single pattern @@ -308,7 +308,7 @@ mod tests { then { x += y; } else { x += 1; } - }; + } assert_eq!(x, 3); } } |