pub fn new(base: u16, units: Vec<&'static str>) -> std::result::Result<Self, Error> {
        if base == 0 {
            return Err(Error::ZeroBase);
        }

        for unit in &units {
            if unit.len() > UNITS_LIM {
                return Err(Error::InvalidUnit(unit));
            }
        }
        Ok(Self { base, units })
    }
/// Create a new scale.
///
/// If a unit is longer than the supported length, an error will be returned.
Create a new scale.
If a unit is longer than the supported length, an error will be returned.
Create a new scale . If a unit is longer than the supported length an error will be returned .
pub fn new(base: u16, units: Vec<&'static str>) -> std::result::Result<Self, Error> {
        if base == 0 {
            return Err(Error::ZeroBase);
        }
        for unit in &units {
            if unit.len() > UNITS_LIM {
                return Err(Error::InvalidUnit(unit));
            }
        }
        Ok(Self { base, units })
    }
pub fn new ( base : u16 , units : Vec < & ' static str > ) -> std :: result :: Result < Self , Error > { if base == 0 { return Err ( Error :: ZeroBase ) ; } for unit in & units { if unit . len ( ) > UNITS_LIM { return Err ( Error :: InvalidUnit ( unit ) ) ; } } Ok ( Self { base , units } ) }
Create a new scale.
Create a new scale .
base
u16
units
Vec<&'static str>
base
u16
units
Vec<&'static str>