fn from_str(s: &str) -> Result<Self, Self::Err> {
        let mut split = s.split('.');
        let mut next = move || split.next().map_or(Ok(0), str::parse);

        Ok(Self {
            major: next()?,
            minor: next()?,
            patch: next()?,
        })
    }
/// Parses a `Version` from a string from the same format in that it is displayed.
/// If a version number is omitted then all following numbers are assumed to be 0 (e.g. "2.4" = "2.4.0").
/// # Errors
/// Returns `std::num::ParseIntError` when `s` contains non digit characters (except
/// the appropriate dots).
Parses a `Version` from a string from the same format in that it is displayed.
If a version number is omitted then all following numbers are assumed to be 0 .
Parses a ` Version ` from a string from the same format in that it is displayed . If a version number is omitted then all following numbers are assumed to be 0 .
fn from_str(s: &str) -> Result<Self, Self::Err> {
        let mut split = s.split('.');
        let mut next = move || split.next().map_or(Ok(0), str::parse);
        Ok(Self {
            major: next()?,
            minor: next()?,
            patch: next()?,
        })
    }
fn from_str ( s : & str ) -> Result < Self , Self :: Err > { let mut split = s . split ( '.' ) ; let mut next = move | | split . next ( ) . map_or ( Ok ( 0 ) , str :: parse ) ; Ok ( Self { major : next ( ) ? , minor : next ( ) ? , patch : next ( ) ? , } ) }
Parses a `Version` from a string from the same format in that it is displayed.
Parses a ` Version ` from a string from the same format in that it is displayed .
s
&str
s
&str
errors
Returns `std::num::ParseIntError` when `s` contains non digit characters (except
the appropriate dots).
Returns ` std :: num :: ParseIntError ` when ` s ` contains non digit characters ( except the appropriate dots ) .