Skip to content

Commit

Permalink
Merge #97
Browse files Browse the repository at this point in the history
97: Document ToBigInt behaviour r=cuviper a=XAMPPRocky

Adds documentation explaining why `ToBigInt` can return `None` in some cases, and when it can be ignored.

Co-authored-by: XAMPPRocky <4464295+xampprocky@users.noreply.github.com>
  • Loading branch information
bors[bot] and XAMPPRocky committed Jul 17, 2019
2 parents b90ed60 + 5446bb8 commit 12763e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,9 @@ impl<'de> serde::Deserialize<'de> for BigInt {
}
}

/// A generic trait for converting a value to a `BigInt`.
/// A generic trait for converting a value to a `BigInt`. This may return
/// `None` when converting from `f32` or `f64`, and will always succeed
/// when converting from any integer or unsigned primitive, or `BigUint`.
pub trait ToBigInt {
/// Converts the value of `self` to a `BigInt`.
fn to_bigint(&self) -> Option<BigInt>;
Expand Down

0 comments on commit 12763e2

Please sign in to comment.