Code like this is ugly, and similar code will exist in lots of places
|
pub(crate) fn init(heap: &mut Heap<impl ResourceTracker>, args: ArgValues, interns: &Interns) -> RunResult<Value> { |
We should support parsing args/kwargs into a struct using serde::Deserialize if it can support all forms of arguments, or a custom procedural macro if it can't.
So you would do something like
#[derive(serde::Deserialize)]
struct FunctionArgs {
#[args_kwargs]
a: i64,
#[kwarg_only]
b: String,
}
Code like this is ugly, and similar code will exist in lots of places
monty/crates/monty/src/types/datetime.rs
Line 183 in 3759c96
We should support parsing args/kwargs into a struct using
serde::Deserializeif it can support all forms of arguments, or a custom procedural macro if it can't.So you would do something like