Skip to content

Commit a939c51

Browse files
author
Kamil Niski
committed
Correct docs for overflowing docs
1 parent bdf0c1d commit a939c51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ops/overflowing.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ macro_rules! overflowing_impl {
1515
};
1616
}
1717

18-
/// If an overflow would have occurred then the wrapped value is returned.
18+
/// Performs addition with a flag for overflow.
1919
pub trait OverflowingAdd: Sized + Add<Self, Output = Self> {
2020
/// Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur.
21+
/// If an overflow would have occurred then the wrapped value is returned.
2122
fn overflowing_add(&self, v: &Self) -> (Self, bool);
2223
}
2324

@@ -37,9 +38,10 @@ overflowing_impl!(OverflowingAdd, overflowing_add, isize);
3738
#[cfg(has_i128)]
3839
overflowing_impl!(OverflowingAdd, overflowing_add, i128);
3940

40-
/// If an overflow would have occurred then the wrapped value is returned.
41+
/// Performs substraction with a flag for overflow.
4142
pub trait OverflowingSub: Sized + Sub<Self, Output = Self> {
4243
/// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur.
44+
/// If an overflow would have occurred then the wrapped value is returned.
4345
fn overflowing_sub(&self, v: &Self) -> (Self, bool);
4446
}
4547

@@ -59,9 +61,10 @@ overflowing_impl!(OverflowingSub, overflowing_sub, isize);
5961
#[cfg(has_i128)]
6062
overflowing_impl!(OverflowingSub, overflowing_sub, i128);
6163

62-
/// If an overflow would have occurred then the wrapped value is returned.
64+
/// Performs multiplication with a flag for overflow.
6365
pub trait OverflowingMul: Sized + Mul<Self, Output = Self> {
6466
/// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur.
67+
/// If an overflow would have occurred then the wrapped value is returned.
6568
fn overflowing_mul(&self, v: &Self) -> (Self, bool);
6669
}
6770

0 commit comments

Comments
 (0)