diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-23 13:24:39 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-23 13:26:10 +0100 |
| commit | 2b8426b1b3a19d46a94abaece674525948c146af (patch) | |
| tree | 35eae5b09cda399224c58543f58a985cfcd00e79 /src/model/methods.rs | |
| parent | 6ca240508eed7288fcc317b9e167f6470a2f952c (diff) | |
Interpret methods on modules as functions in modules
Diffstat (limited to 'src/model/methods.rs')
| -rw-r--r-- | src/model/methods.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/model/methods.rs b/src/model/methods.rs index 3823df41..f80839f8 100644 --- a/src/model/methods.rs +++ b/src/model/methods.rs @@ -153,6 +153,7 @@ pub fn call_mut( }, Value::Dict(dict) => match method { + "insert" => dict.insert(args.expect::<Str>("key")?, args.expect("value")?), "remove" => { output = dict.remove(&args.expect::<EcoString>("key")?).at(span)? } @@ -184,7 +185,7 @@ pub fn call_access<'a>( _ => return missing(), }, Value::Dict(dict) => match method { - "at" => dict.at_mut(args.expect("index")?), + "at" => dict.at_mut(&args.expect::<Str>("key")?).at(span)?, _ => return missing(), }, _ => return missing(), |
