ISibboI / evalexpr

A powerful expression evaluation crate 🦀.
GNU Affero General Public License v3.0
325 stars 54 forks source link

Add an "if" function #100

Closed lovasoa closed 2 years ago

lovasoa commented 2 years ago

If the first argument is true, returns the second argument, otherwise, return the third

lovasoa commented 2 years ago

By the way, the signature of pub fn as_fixed_len_tuple(&self, len: usize) -> EvalexprResult<TupleType> is a little bit strange. It should probably be either

pub fn as_fixed_len_tuple(&self, len: usize) -> EvalexprResult<&TupleType>

or

pub fn into_fixed_len_tuple(self, len: usize) -> EvalexprResult<TupleType>
lovasoa commented 2 years ago

@ISibboI, what do you think ?

ISibboI commented 2 years ago

Thanks, looks good!

lovasoa commented 2 years ago

:tada: