summaryrefslogtreecommitdiff
path: root/src/model/dict.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/dict.rs')
-rw-r--r--src/model/dict.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/model/dict.rs b/src/model/dict.rs
index 6e014d7e..e3c5454e 100644
--- a/src/model/dict.rs
+++ b/src/model/dict.rs
@@ -79,10 +79,10 @@ impl Dict {
Arc::make_mut(&mut self.0).insert(key, value);
}
- /// Remove a mapping by `key`.
- pub fn remove(&mut self, key: &str) -> StrResult<()> {
+ /// Remove a mapping by `key` and return the value.
+ pub fn remove(&mut self, key: &str) -> StrResult<Value> {
match Arc::make_mut(&mut self.0).remove(key) {
- Some(_) => Ok(()),
+ Some(value) => Ok(value),
None => Err(missing_key(key)),
}
}