1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

feat: add remove_string() to storage trait (#8264)

<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/main/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* [X] I have followed the instructions in the PR template

This PR adds a `remove_string()` API to the Storage trait and also
implements it in the `FileStorage` and `LocalStorage` stucts.
This commit is contained in:
mike
2026-06-25 06:34:12 -04:00
committed by GitHub
parent 3fdcef15ab
commit 26ead4af21
4 changed files with 29 additions and 0 deletions

View File

@@ -159,6 +159,11 @@ impl crate::Storage for FileStorage {
}
}
fn remove_string(&mut self, key: &str) {
self.kv.remove(key);
self.dirty = true;
}
fn flush(&mut self) {
if self.dirty {
profiling::scope!("FileStorage::flush");