Skip to content

Commit

Permalink
chore(121952): echo comments on the *_assign methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvisCraft committed Mar 17, 2024
1 parent 5ebed0b commit e7d3970
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ macro_rules! nonzero_integer_signedness_dependent_impls {

#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
impl DivAssign<$Ty> for $Int {
/// This operation rounds towards zero,
/// truncating any fractional part of the exact result, and cannot panic.
#[inline]
fn div_assign(&mut self, other: $Ty) {
*self = *self / other;
Expand All @@ -872,6 +874,7 @@ macro_rules! nonzero_integer_signedness_dependent_impls {

#[stable(feature = "nonzero_div_assign", since = "CURRENT_RUSTC_VERSION")]
impl RemAssign<$Ty> for $Int {
/// This operation satisfies `n % d == n - (n / d) * d`, and cannot panic.
#[inline]
fn rem_assign(&mut self, other: $Ty) {
*self = *self % other;
Expand Down

0 comments on commit e7d3970

Please sign in to comment.