Skip to content

Commit

Permalink
Document ToBigInt behaviour
Browse files Browse the repository at this point in the history
Adds documentation explaining why `ToBigInt` can return `None` in some cases, and when it can be ignored.
  • Loading branch information
XAMPPRocky authored Jul 13, 2019
1 parent b90ed60 commit 5446bb8
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 5446bb8

Please sign in to comment.