Fix documention for double using f64 and float

This commit is contained in:
Nils 2021-08-28 21:16:03 +01:00 committed by Geoffroy Couprie
parent 615e6a441e
commit a6cd401274
2 changed files with 6 additions and 6 deletions

View File

@ -1560,16 +1560,16 @@ where
Ok((i, float))
}
/// Recognizes floating point number in text format and returns a f32.
/// Recognizes floating point number in text format and returns a f64.
///
/// *Complete version*: Can parse until the end of input.
/// ```rust
/// # use nom::{Err, error::ErrorKind, Needed};
/// # use nom::Needed::Size;
/// use nom::number::complete::float;
/// use nom::number::complete::double;
///
/// let parser = |s| {
/// float(s)
/// double(s)
/// };
///
/// assert_eq!(parser("11e-1"), Ok(("", 1.1)));

View File

@ -1534,17 +1534,17 @@ where
Ok((i, float))
}
/// Recognizes floating point number in text format and returns a f32.
/// Recognizes floating point number in text format and returns a f64.
///
/// *Streaming version*: Will return `Err(nom::Err::Incomplete(_))` if there is not enough data.
///
/// ```rust
/// # use nom::{Err, error::ErrorKind, Needed};
/// # use nom::Needed::Size;
/// use nom::number::complete::float;
/// use nom::number::complete::double;
///
/// let parser = |s| {
/// float(s)
/// double(s)
/// };
///
/// assert_eq!(parser("11e-1"), Ok(("", 1.1)));