Implement Storage trait for egui_web:s local storage bindings

This commit is contained in:
Emil Ernerfeldt
2020-12-19 14:58:00 +01:00
parent 7ff5d4726b
commit 99808d2df8
3 changed files with 19 additions and 5 deletions
+2 -2
View File
@@ -25,8 +25,8 @@ impl FileStorage {
}
impl egui::app::Storage for FileStorage {
fn get_string(&self, key: &str) -> Option<&str> {
self.kv.get(key).map(String::as_str)
fn get_string(&self, key: &str) -> Option<String> {
self.kv.get(key).cloned()
}
fn set_string(&mut self, key: &str, value: String) {