Correct the documentation of where app state is saved

Replaces https://github.com/emilk/egui/pull/263
This commit is contained in:
Emil Ernerfeldt 2021-03-31 19:51:19 +02:00
parent 4808da44a2
commit c583f94ef0

View file

@ -89,10 +89,12 @@ pub trait App {
/// Called on shutdown, and perhaps at regular intervals. Allows you to save state. /// Called on shutdown, and perhaps at regular intervals. Allows you to save state.
/// ///
/// On web the states is stored to "Local Storage". /// On web the states is stored to "Local Storage".
/// On native the path is picked using [`directories_next::ProjectDirs`](https://docs.rs/directories-next/latest/directories_next/struct.ProjectDirs.html) which is: /// On native the path is picked using [`directories_next::ProjectDirs::data_dir`](https://docs.rs/directories-next/2.0.0/directories_next/struct.ProjectDirs.html#method.data_dir) which is:
/// * Linux: `/home/UserName/.config/appname` /// * Linux: `/home/UserName/.local/share/APPNAME`
/// * macOS: `/Users/UserName/Library/Application Support/appname` /// * macOS: `/Users/UserName/Library/Application Support/APPNAME`
/// * Windows: `C:\Users\UserName\AppData\Roaming\appname` /// * Windows: `C:\Users\UserName\AppData\Roaming\APPNAME`
///
/// where `APPNAME` is what is returned by [`Self::name()`].
fn save(&mut self, _storage: &mut dyn Storage) {} fn save(&mut self, _storage: &mut dyn Storage) {}
/// Called once on shutdown (before or after `save()`) /// Called once on shutdown (before or after `save()`)