remove dead code

This commit is contained in:
Ophir LOJKINE 2022-03-14 15:50:08 +01:00
parent 004c2c9f03
commit 7522df14b7

View File

@ -122,18 +122,12 @@ pub fn builtin_function(identifier: &str) -> Option<Function> {
} }
})), })),
"if" => Some(Function::new(|argument| { "if" => Some(Function::new(|argument| {
if let [condition, if_true, if_false] = &argument.as_fixed_len_tuple(3)?[..] { let arguments = &argument.as_fixed_len_tuple(3)?;
return Ok(if condition.as_boolean()? { Ok(if arguments[0].as_boolean()? {
if_true arguments[1].clone()
} else { } else {
if_false arguments[2].clone()
} })
.clone());
}
Err(EvalexprError::type_error(
argument.clone(),
vec![ValueType::Boolean, ValueType::Empty, ValueType::Empty],
))
})), })),
"len" => Some(Function::new(|argument| { "len" => Some(Function::new(|argument| {
if let Ok(subject) = argument.as_string() { if let Ok(subject) = argument.as_string() {