This second API seems like it's trying to avoid adding unescessary 'get_or_insert_default()' calls
This commit is contained in:
@@ -136,7 +136,6 @@ impl VsCodeSettings {
|
||||
}
|
||||
}
|
||||
|
||||
// todo! replace enum_setting
|
||||
pub fn read_enum<T>(&self, key: &str, f: impl FnOnce(&str) -> Option<T>) -> Option<T> {
|
||||
self.content.get(key).and_then(Value::as_str).and_then(f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user