mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-27 01:30:32 +00:00
Fix documention for double using f64 and float
This commit is contained in:
parent
615e6a441e
commit
a6cd401274
@ -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)));
|
||||
|
@ -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)));
|
||||
|
Loading…
Reference in New Issue
Block a user