fn check_pct_opt(v: Value) -> Result<Rational, String> {
    let v = super::check::numeric(v)?;
    if !v.unit.is_percent() {
        // Note: The deprecation warning should include the parameter name
        // and line of call, but we don't have that here.
        dep_warn!(
            "Passing a number without unit % ({}) is deprecated.",
            v.format(Format::introspect())
        );
    }
    Ok(v.as_ratio()? / 100)
}
/// Gets a percentage as a fraction 0 .. 1.
/// If v is not a percentage, keep it as it is.
Gets a percentage as a fraction 0 .. 1.
If v is not a percentage, keep it as it is.
Gets a percentage as a fraction 0 .. 1 . If v is not a percentage keep it as it is .
fn check_pct_opt(v: Value) -> Result<Rational, String> {
    let v = super::check::numeric(v)?;
    if !v.unit.is_percent() {
        // Note: The deprecation warning should include the parameter name
        // and line of call, but we don't have that here.
        dep_warn!(
            "Passing a number without unit % ({}) is deprecated.",
            v.format(Format::introspect())
        );
    }
    Ok(v.as_ratio()? / 100)
}
fn check_pct_opt ( v : Value ) -> Result < Rational , String > { let v = super :: check :: numeric ( v ) ? ; if ! v . unit . is_percent ( ) { // Note: The deprecation warning should include the parameter name // and line of call, but we don't have that here. dep_warn ! ( " " v format ( Format introspect ( ) ) ) ; } Ok ( v . as_ratio ( ) ? / 100 ) }
Gets a percentage as a fraction 0 .. 1.
Gets a percentage as a fraction 0 .. 1 .
v
Value
v
Value