Skip to content

Commit

Permalink
Rollup merge of #104354 - lukas-code:blank-lines-2, r=JohnTitor
Browse files Browse the repository at this point in the history
Remove leading newlines from `NonZero*` doc examples

Like #103045, but for `NonZero*`.

`@rustbot` label A-docs
  • Loading branch information
matthiaskrgr committed Nov 15, 2022
2 parents 98be657 + ce10ac0 commit 1b41a38
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let one = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -356,7 +355,6 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let one = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -391,8 +389,8 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let one = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -420,7 +418,6 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let two = ", stringify!($Ty), "::new(2)?;")]
Expand Down Expand Up @@ -461,7 +458,6 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(7).unwrap().ilog2(), 2);")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(8).unwrap().ilog2(), 3);")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(9).unwrap().ilog2(), 3);")]
Expand All @@ -486,7 +482,6 @@ macro_rules! nonzero_unsigned_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(99).unwrap().ilog10(), 1);")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(100).unwrap().ilog10(), 2);")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::new(101).unwrap().ilog10(), 2);")]
Expand Down Expand Up @@ -526,7 +521,6 @@ macro_rules! nonzero_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let pos = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -556,7 +550,6 @@ macro_rules! nonzero_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let pos = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -591,7 +584,6 @@ macro_rules! nonzero_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let pos = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -626,7 +618,6 @@ macro_rules! nonzero_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let pos = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -662,7 +653,6 @@ macro_rules! nonzero_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let pos = ", stringify!($Ty), "::new(1)?;")]
Expand Down Expand Up @@ -905,7 +895,6 @@ macro_rules! nonzero_unsigned_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let two = ", stringify!($Ty), "::new(2)?;")]
Expand Down Expand Up @@ -941,7 +930,6 @@ macro_rules! nonzero_unsigned_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let two = ", stringify!($Ty), "::new(2)?;")]
Expand Down Expand Up @@ -986,8 +974,8 @@ macro_rules! nonzero_unsigned_signed_operations {
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let two = ", stringify!($Ty), "::new(2)?;")]
Expand All @@ -1014,7 +1002,6 @@ macro_rules! nonzero_unsigned_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let three = ", stringify!($Ty), "::new(3)?;")]
Expand Down Expand Up @@ -1058,7 +1045,6 @@ macro_rules! nonzero_unsigned_signed_operations {
///
/// ```
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
/// # fn test() -> Option<()> {
#[doc = concat!("let three = ", stringify!($Ty), "::new(3)?;")]
Expand Down Expand Up @@ -1162,8 +1148,8 @@ macro_rules! nonzero_min_max_unsigned {
///
/// ```
/// #![feature(nonzero_min_max)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::MIN.get(), 1", stringify!($Int), ");")]
/// ```
#[unstable(feature = "nonzero_min_max", issue = "89065")]
Expand All @@ -1177,8 +1163,8 @@ macro_rules! nonzero_min_max_unsigned {
///
/// ```
/// #![feature(nonzero_min_max)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::MAX.get(), ", stringify!($Int), "::MAX);")]
/// ```
#[unstable(feature = "nonzero_min_max", issue = "89065")]
Expand All @@ -1204,8 +1190,8 @@ macro_rules! nonzero_min_max_signed {
///
/// ```
/// #![feature(nonzero_min_max)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::MIN.get(), ", stringify!($Int), "::MIN);")]
/// ```
#[unstable(feature = "nonzero_min_max", issue = "89065")]
Expand All @@ -1223,8 +1209,8 @@ macro_rules! nonzero_min_max_signed {
///
/// ```
/// #![feature(nonzero_min_max)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
#[doc = concat!("assert_eq!(", stringify!($Ty), "::MAX.get(), ", stringify!($Int), "::MAX);")]
/// ```
#[unstable(feature = "nonzero_min_max", issue = "89065")]
Expand Down

0 comments on commit 1b41a38

Please sign in to comment.