about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-21 14:11:09 +0100
committerGitHub <noreply@github.com>2022-11-21 14:11:09 +0100
commit369e44943fe7b915e8b9c88d107f525f6a3d6565 (patch)
tree25fb863bd476a3e7e2c43b8cb52a0a8bcfea39bb
parent736c675d2ab65bcde6554e1b73340c2dbc27c85a (diff)
parent00bf999fcf9b20c3c6ea2bf77eaafaebf8a761de (diff)
downloadrust-369e44943fe7b915e8b9c88d107f525f6a3d6565.tar.gz
rust-369e44943fe7b915e8b9c88d107f525f6a3d6565.zip
Rollup merge of #104420 - TethysSvensson:master, r=JohnTitor
Fix doc example for `wrapping_abs`

The `max` variable is unused. This change introduces the `min_plus` variable, to make the example similar to the one from `saturating_abs`. An alternative would be to remove the unused variable.
-rw-r--r--library/core/src/num/nonzero.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index 6a417b54daa..141cbc7669b 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -659,7 +659,7 @@ macro_rules! nonzero_signed_operations {
                 #[doc = concat!("let neg = ", stringify!($Ty), "::new(-1)?;")]
                 #[doc = concat!("let min = ", stringify!($Ty), "::new(",
                                 stringify!($Int), "::MIN)?;")]
-                #[doc = concat!("let max = ", stringify!($Ty), "::new(",
+                #[doc = concat!("# let max = ", stringify!($Ty), "::new(",
                                 stringify!($Int), "::MAX)?;")]
                 ///
                 /// assert_eq!(pos, pos.wrapping_abs());