Improve documentation of checked_* functions
This commit is contained in:
parent
8dbe63200d
commit
6182084e58
@ -284,7 +284,7 @@ pub trait Int
|
|||||||
/// ```
|
/// ```
|
||||||
fn checked_add(self, other: Self) -> Option<Self>;
|
fn checked_add(self, other: Self) -> Option<Self>;
|
||||||
|
|
||||||
/// Checked integer subtraction. Computes `self + other`, returning `None`
|
/// Checked integer subtraction. Computes `self - other`, returning `None`
|
||||||
/// if underflow occurred.
|
/// if underflow occurred.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
@ -297,7 +297,7 @@ pub trait Int
|
|||||||
/// ```
|
/// ```
|
||||||
fn checked_sub(self, other: Self) -> Option<Self>;
|
fn checked_sub(self, other: Self) -> Option<Self>;
|
||||||
|
|
||||||
/// Checked integer multiplication. Computes `self + other`, returning
|
/// Checked integer multiplication. Computes `self * other`, returning
|
||||||
/// `None` if underflow or overflow occurred.
|
/// `None` if underflow or overflow occurred.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
@ -310,8 +310,8 @@ pub trait Int
|
|||||||
/// ```
|
/// ```
|
||||||
fn checked_mul(self, other: Self) -> Option<Self>;
|
fn checked_mul(self, other: Self) -> Option<Self>;
|
||||||
|
|
||||||
/// Checked integer division. Computes `self + other` returning `None` if
|
/// Checked integer division. Computes `self / other`, returning `None` if
|
||||||
/// `self == 0` or the operation results in underflow or overflow.
|
/// `other == 0` or the operation results in underflow or overflow.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user