fix(sprout): correct rustdoc and clarify safety in some places

This commit is contained in:
2025-10-27 16:16:09 -04:00
parent 6086778dc0
commit 8a2e8c8127
3 changed files with 8 additions and 4 deletions

View File

@@ -118,7 +118,10 @@ impl SproutContext {
pub fn all_values(&self) -> BTreeMap<String, String> {
let mut values = BTreeMap::new();
for key in self.all_keys() {
values.insert(key.clone(), self.get(key).cloned().unwrap_or_default());
// Acquire the value from the context. Since retrieving all the keys will give us
// a full view of the context, we can be sure that the key exists.
let value = self.get(&key).cloned().unwrap_or_default();
values.insert(key.clone(), value);
}
values
}