chore(121952): echo comments on the *_assign
methods
This commit is contained in:
parent
5ebed0ba4b
commit
e7d397024f
1 changed files with 3 additions and 0 deletions
|
@ -851,6 +851,8 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
|
||||||
|
|
||||||
#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
|
#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
|
||||||
impl DivAssign<$Ty> for $Int {
|
impl DivAssign<$Ty> for $Int {
|
||||||
|
/// This operation rounds towards zero,
|
||||||
|
/// truncating any fractional part of the exact result, and cannot panic.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn div_assign(&mut self, other: $Ty) {
|
fn div_assign(&mut self, other: $Ty) {
|
||||||
*self = *self / other;
|
*self = *self / other;
|
||||||
|
@ -872,6 +874,7 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
|
||||||
|
|
||||||
#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
|
#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
|
||||||
impl RemAssign<$Ty> for $Int {
|
impl RemAssign<$Ty> for $Int {
|
||||||
|
/// This operation satisfies `n % d == n - (n / d) * d`, and cannot panic.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn rem_assign(&mut self, other: $Ty) {
|
fn rem_assign(&mut self, other: $Ty) {
|
||||||
*self = *self % other;
|
*self = *self % other;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue