amount: Fix docs on FromStr
The docs on `FromStr` say "string slice is zero" but actually mean to document the behaviour when the value represented is zero. Also the fact that `FromStr` returns an error if parsing fails is self evident.
This commit is contained in:
parent
5bec76aa51
commit
3e332c3839
|
@ -396,12 +396,7 @@ impl FromStr for SignedAmount {
|
||||||
|
|
||||||
/// Parses a string slice where the slice includes a denomination.
|
/// Parses a string slice where the slice includes a denomination.
|
||||||
///
|
///
|
||||||
/// If the string slice is zero or negative zero, then no denomination is required.
|
/// If the returned value would be zero or negative zero, then no denomination is required.
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
///
|
|
||||||
/// The amount if the string amount and denomination parse successfully,
|
|
||||||
/// otherwise returns `Err(ParseError)`.
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
let result = SignedAmount::from_str_with_denomination(s);
|
let result = SignedAmount::from_str_with_denomination(s);
|
||||||
|
|
||||||
|
|
|
@ -361,12 +361,7 @@ impl FromStr for Amount {
|
||||||
|
|
||||||
/// Parses a string slice where the slice includes a denomination.
|
/// Parses a string slice where the slice includes a denomination.
|
||||||
///
|
///
|
||||||
/// If the string slice is zero, then no denomination is required.
|
/// If the returned value would be zero or negative zero, then no denomination is required.
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
///
|
|
||||||
/// The amount if the string amount and denomination parse successfully,
|
|
||||||
/// otherwise returns `Err(ParseError)`.
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
let result = Amount::from_str_with_denomination(s);
|
let result = Amount::from_str_with_denomination(s);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue