Skip to content

Commit

Permalink
improve safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-shrimp committed Jul 19, 2024
1 parent 9348998 commit f3b1c8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
// Inform the optimizer about it.
unsafe { hint::assert_unchecked(res < 1 << (Self::BITS / 2)) };

// SAFETY: The result is positive.
// SAFETY: The square root of an integer >= 1 is always >= 1.
unsafe { Self::new_unchecked(res) }
}
};
Expand Down

0 comments on commit f3b1c8a

Please sign in to comment.