reword debug mode -> when debug assertions are enabled

This commit is contained in:
Trevor Spiteri 2019-02-21 19:07:54 +01:00
parent c0a8952f41
commit 955dfaa618
3 changed files with 44 additions and 39 deletions

View File

@ -63,9 +63,10 @@ Any extra fractional bits are truncated.
# Panics
In debug mode, panics if the value does not fit. In release mode the
value is wrapped, but it is not considered a breaking change if in the
future it panics; if wrapping is required use [`wrapping_from_fixed`]
When debug assertions are enabled, panics if the value does not fit.
When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_from_fixed`]
instead.
# Examples
@ -104,10 +105,10 @@ Any extra fractional bits are truncated.
# Panics
In debug mode, panics if the value does not fit. In release mode the
value is wrapped, but it is not considered a breaking change if in the
future it panics; if wrapping is required use [`wrapping_to_fixed`]
instead.
When debug assertions are enabled, panics if the value does not fit.
When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_to_fixed`] instead.
# Examples
@ -145,10 +146,10 @@ The integer can be of type [`i8`], [`i16`], [`i32`], [`i64`],
# Panics
In debug mode, panics if the value does not fit. In release mode the
value is wrapped, but it is not considered a breaking change if in the
future it panics; if wrapping is required use [`wrapping_from_int`]
instead.
When debug assertions are enabled, panics if the value does not fit.
When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_from_int`] instead.
# Examples
@ -200,10 +201,10 @@ Any fractional bits are truncated.
# Panics
In debug mode, panics if the value does not fit. In release mode the
value is wrapped, but it is not considered a breaking change if in the
future it panics; if wrapping is required use [`wrapping_to_int`]
instead.
When debug assertions are enabled, panics if the value does not fit.
When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_to_int`] instead.
# Examples
@ -259,10 +260,11 @@ This method rounds to the nearest, with ties rounding to even.
Panics if the value is not [finite].
In debug mode, also panics if the value does not fit. In release mode
the value is wrapped, but it is not considered a breaking change if in
the future it panics; if wrapping is required use
[`wrapping_from_float`] instead.
When debug assertions are enabled, panics if the value does not fit.
When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_from_float`]
instead.
# Examples

View File

@ -112,10 +112,10 @@ assert_eq!((-two_and_quarter).frac(), three_quarters);
# Panics
In debug mode, panics if the result does not fit. In release mode the
result is wrapped, but it is not considered a breaking change if in
the future it panics; if wrapping is required use [`wrapping_ceil`]
instead.
When debug assertions are enabled, panics if the result does not fit.
When debug assertions are not enabled, the wrapped result can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_ceil`] instead.
# Examples
@ -152,10 +152,10 @@ assert_eq!(two_half.ceil(), Fix::from_int(3));
$Signedness,
"# Panics
In debug mode, panics if the result does not fit. In release mode the
result is wrapped, but it is not considered a breaking change if in
the future it panics; if wrapping is required use [`wrapping_floor`]
instead.
When debug assertions are enabled, panics if the result does not fit.
When debug assertions are not enabled, the wrapped result can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_floor`] instead.
Overflow can only occur when there are zero integer bits.
@ -194,10 +194,10 @@ from zero.
# Panics
In debug mode, panics if the result does not fit. In release mode the
result is wrapped, but it is not considered a breaking change if in
the future it panics; if wrapping is required use [`wrapping_round`]
instead.
When debug assertions are enabled, panics if the result does not fit.
When debug assertions are not enabled, the wrapped result can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use [`wrapping_round`] instead.
# Examples

View File

@ -51,8 +51,9 @@ pub trait Int: SealedInt {
///
/// # Panics
///
/// In debug mode, panics if the value does not fit. In release
/// mode the value is wrapped, but it is not considered a breaking
/// When debug assertions are enabled, panics if the value does
/// not fit. When debug assertions are not enabled, the wrapped
/// value can be returned, but it is not considered a breaking
/// change if in the future it panics; if wrapping is required use
/// [`wrapping_from_fixed`] instead.
///
@ -81,8 +82,9 @@ pub trait Int: SealedInt {
///
/// # Panics
///
/// In debug mode, panics if the value does not fit. In release
/// mode the value is wrapped, but it is not considered a breaking
/// When debug assertions are enabled, panics if the value does
/// not fit. When debug assertions are not enabled, the wrapped
/// value can be returned, but it is not considered a breaking
/// change if in the future it panics; if wrapping is required use
/// [`wrapping_to_fixed`] instead.
///
@ -340,10 +342,11 @@ pub trait Float: SealedFloat {
///
/// Panics if the value is not [finite].
///
/// In debug mode, also panics if the value does not fit. In release mode
/// the value is wrapped, but it is not considered a breaking change if in
/// the future it panics; if wrapping is required use
/// [`wrapping_to_fixed`] instead.
/// When debug assertions are enabled, also panics if the value
/// does not fit. When debug assertions are not enabled, the
/// wrapped value can be returned, but it is not considered a
/// breaking change if in the future it panics; if wrapping is
/// required use [`wrapping_to_fixed`] instead.
///
/// # Examples
///