diff --git a/Cargo.toml b/Cargo.toml index 009fa195..2bce54ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Isaiah Inuwa ", "Anthony Ramine ", ] -version = "0.1.2" +version = "0.1.3" repository = "https://github.com/ruma/ruma-serde" edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index b0369f6b..ae83bd69 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,13 @@ pub fn default_true() -> bool { true } +/// Simplfy dereferences the given bool. +/// +/// Useful for `#[serde(skip_serializing_if = ...)]` +pub fn is_true(b: &bool) -> bool { + *b +} + /// Serde deserialization decorator to map empty Strings to None, /// and forward non-empty Strings to the Deserialize implementation for T. /// Useful for the typical