diff --git a/egui/Cargo.toml b/egui/Cargo.toml index 7cfc65d8..2e99b0dd 100644 --- a/egui/Cargo.toml +++ b/egui/Cargo.toml @@ -23,7 +23,7 @@ ahash = { version = "0.6", features = ["std"], default-features = false } atomic_refcell = { version = "0.1", optional = true } # Used instead of parking_lot when you are always using Egui in a single thread. About as fast as parking_lot. Panics on multi-threaded use of egui::Context. parking_lot = { version = "0.11", optional = true } # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios rusttype = "0.9" -serde = { version = "1", features = ["derive"], optional = true } +serde = { version = "1", features = ["derive", "rc"], optional = true } [features] default = ["atomic_refcell", "default_fonts"] diff --git a/egui/src/context.rs b/egui/src/context.rs index 428d4a57..8efe7880 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -15,6 +15,8 @@ use crate::{ // ---------------------------------------------------------------------------- #[derive(Clone, Debug, Default)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +#[cfg_attr(feature = "serde", serde(default))] struct Options { /// The default style for new `Ui`:s. style: Arc