Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor memory data #836

Merged
merged 11 commits into from
Oct 27, 2021
Prev Previous commit
Next Next commit
Fixes for when not using persistance feature
  • Loading branch information
emilk committed Oct 26, 2021
commit a4bfcceff395f3708e95413603a9684019155554
1 change: 0 additions & 1 deletion egui/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub struct Memory {
/// This will be saved between different program runs if you use the `persistence` feature.
///
/// To store a state common for all your widgets (a singleton), use [`Id::null`] as the key.
#[cfg(feature = "persistence")]
pub data: crate::util::IdAnyMap,

// ------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions egui/src/util/id_any_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct SerializedElement {
ron: String,
}

#[cfg(feature = "persistence")]
type Serializer = fn(&Box<dyn Any + 'static + Send + Sync>) -> Option<String>;

enum Element {
Expand Down