Skip to content

Commit

Permalink
Fix misleading BigInt rustdoc
Browse files Browse the repository at this point in the history
The original documentation was unclear about the value of the bool. I interpreted it as being `true` if the value was truncated.
  • Loading branch information
guillaumebort committed Jan 5, 2024
1 parent 60e0859 commit 3bfb859
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ impl BigInt {
}

/// Returns the value of this BigInt as an unsigned 64-bit integer, and a
/// `bool` indicating whether the return value was truncated was truncated or
/// wrapped around. In particular, it will be `false` if this BigInt is
/// negative.
/// `bool` indicating whether the conversion was lossless or not.
/// The boolean value will be `false` if the return value was truncated or wrapped around,
/// in particular if the BigInt is negative.
#[inline(always)]
pub fn u64_value(&self) -> (u64, bool) {
let mut lossless = MaybeUninit::uninit();
Expand All @@ -91,7 +91,8 @@ impl BigInt {
}

/// Returns the value of this BigInt as a signed 64-bit integer, and a `bool`
/// indicating whether this BigInt was truncated or not.
/// indicating whether the conversion was lossless or not.
/// The boolean value will be `false` if the return value was truncated or wrapped around.
#[inline(always)]
pub fn i64_value(&self) -> (i64, bool) {
let mut lossless = MaybeUninit::uninit();
Expand Down

0 comments on commit 3bfb859

Please sign in to comment.