Extract a numeric argument with bool coercion.
(args: &[Value], idx: usize)
| 17 | |
| 18 | /// Extract a numeric argument with bool coercion. |
| 19 | pub fn num_arg(args: &[Value], idx: usize) -> Option<f64> { |
| 20 | args.get(idx) |
| 21 | .and_then(|v| crate::value_ops::value_to_f64(v, true)) |
| 22 | } |
| 23 | |
| 24 | /// Check if the first arg is a string matching a predicate. |
| 25 | pub fn bool_id_check(args: &[Value], check: impl Fn(&str) -> bool) -> Value { |
no test coverage detected