Skip to content

Commit 0726ec9

Browse files
authored
Rollup merge of rust-lang#101190 - yjhn:patch-1, r=Mark-Simulacrum
Make docs formulation more consistent for NonZero{int} Use third person, as it is used for other `std` documentation.
2 parents 794d138 + de6a3ec commit 0726ec9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

library/core/src/num/nonzero.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ macro_rules! nonzero_unsigned_operations {
309309
( $( $Ty: ident($Int: ident); )+ ) => {
310310
$(
311311
impl $Ty {
312-
/// Add an unsigned integer to a non-zero value.
313-
/// Check for overflow and return [`None`] on overflow
312+
/// Adds an unsigned integer to a non-zero value.
313+
/// Checks for overflow and returns [`None`] on overflow.
314314
/// As a consequence, the result cannot wrap to zero.
315315
///
316316
///
@@ -346,7 +346,7 @@ macro_rules! nonzero_unsigned_operations {
346346
}
347347
}
348348

349-
/// Add an unsigned integer to a non-zero value.
349+
/// Adds an unsigned integer to a non-zero value.
350350
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
351351
///
352352
/// # Examples
@@ -377,7 +377,7 @@ macro_rules! nonzero_unsigned_operations {
377377
unsafe { $Ty::new_unchecked(self.get().saturating_add(other)) }
378378
}
379379

380-
/// Add an unsigned integer to a non-zero value,
380+
/// Adds an unsigned integer to a non-zero value,
381381
/// assuming overflow cannot occur.
382382
/// Overflow is unchecked, and it is undefined behaviour to overflow
383383
/// *even if the result would wrap to a non-zero value*.
@@ -409,7 +409,7 @@ macro_rules! nonzero_unsigned_operations {
409409
}
410410

411411
/// Returns the smallest power of two greater than or equal to n.
412-
/// Check for overflow and return [`None`]
412+
/// Checks for overflow and returns [`None`]
413413
/// if the next power of two is greater than the type’s maximum value.
414414
/// As a consequence, the result cannot wrap to zero.
415415
///
@@ -545,7 +545,7 @@ macro_rules! nonzero_signed_operations {
545545
}
546546

547547
/// Checked absolute value.
548-
/// Check for overflow and returns [`None`] if
548+
/// Checks for overflow and returns [`None`] if
549549
#[doc = concat!("`self == ", stringify!($Int), "::MIN`.")]
550550
/// The result cannot be zero.
551551
///
@@ -740,8 +740,8 @@ macro_rules! nonzero_unsigned_signed_operations {
740740
( $( $signedness:ident $Ty: ident($Int: ty); )+ ) => {
741741
$(
742742
impl $Ty {
743-
/// Multiply two non-zero integers together.
744-
/// Check for overflow and return [`None`] on overflow.
743+
/// Multiplies two non-zero integers together.
744+
/// Checks for overflow and returns [`None`] on overflow.
745745
/// As a consequence, the result cannot wrap to zero.
746746
///
747747
/// # Examples
@@ -777,7 +777,7 @@ macro_rules! nonzero_unsigned_signed_operations {
777777
}
778778
}
779779

780-
/// Multiply two non-zero integers together.
780+
/// Multiplies two non-zero integers together.
781781
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
782782
///
783783
/// # Examples
@@ -809,7 +809,7 @@ macro_rules! nonzero_unsigned_signed_operations {
809809
unsafe { $Ty::new_unchecked(self.get().saturating_mul(other.get())) }
810810
}
811811

812-
/// Multiply two non-zero integers together,
812+
/// Multiplies two non-zero integers together,
813813
/// assuming overflow cannot occur.
814814
/// Overflow is unchecked, and it is undefined behaviour to overflow
815815
/// *even if the result would wrap to a non-zero value*.
@@ -849,8 +849,8 @@ macro_rules! nonzero_unsigned_signed_operations {
849849
unsafe { $Ty::new_unchecked(self.get().unchecked_mul(other.get())) }
850850
}
851851

852-
/// Raise non-zero value to an integer power.
853-
/// Check for overflow and return [`None`] on overflow.
852+
/// Raises non-zero value to an integer power.
853+
/// Checks for overflow and returns [`None`] on overflow.
854854
/// As a consequence, the result cannot wrap to zero.
855855
///
856856
/// # Examples

0 commit comments

Comments
 (0)