Closed eitsupi closed 5 months ago
Hm, good point. Let me consider adding a feature.
This should work now.
#[savvy]
fn default_value_vec(x: Option<IntegerSexp>) -> savvy::Result<Sexp> {
if let Some(x) = x {
x.iter().sum::<i32>().try_into()
} else {
(-1).try_into()
}
}
Awsome! Thanks for the quick update!
Sometimes there are optional arguments like
Option<String>
in Rust. Is there a recommended way to create a wrapper in savvy for a function with such arguments?