Remove as_i64 and as_f64 (#14258)

# Description
Turns out there are duplicate conversion functions: `as_i64` and
`as_f64`. In most cases, these can be replaced with `as_int` and
`as_float`, respectively.
This commit is contained in:
Ian Manske
2024-11-05 00:28:56 -08:00
committed by GitHub
parent 1e051e573d
commit e87a35104a
9 changed files with 33 additions and 61 deletions

View File

@ -47,9 +47,9 @@ impl PluginCommand for Sum {
) -> Result<PipelineData, LabeledError> {
let mut acc = IntOrFloat::Int(0);
for value in input {
if let Ok(n) = value.as_i64() {
if let Ok(n) = value.as_int() {
acc.add_i64(n);
} else if let Ok(n) = value.as_f64() {
} else if let Ok(n) = value.as_float() {
acc.add_f64(n);
} else {
return Err(LabeledError::new("Sum only accepts ints and floats")