Add is_true
This commit is contained in:
parent
2fb17f30be
commit
25f302f491
@ -8,7 +8,7 @@ authors = [
|
|||||||
"Isaiah Inuwa <isaiah.inuwa@gmail.com>",
|
"Isaiah Inuwa <isaiah.inuwa@gmail.com>",
|
||||||
"Anthony Ramine <n.oxyde@gmail.com>",
|
"Anthony Ramine <n.oxyde@gmail.com>",
|
||||||
]
|
]
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
repository = "https://github.com/ruma/ruma-serde"
|
repository = "https://github.com/ruma/ruma-serde"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
@ -23,6 +23,13 @@ pub fn default_true() -> bool {
|
|||||||
true
|
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,
|
/// Serde deserialization decorator to map empty Strings to None,
|
||||||
/// and forward non-empty Strings to the Deserialize implementation for T.
|
/// and forward non-empty Strings to the Deserialize implementation for T.
|
||||||
/// Useful for the typical
|
/// Useful for the typical
|
||||||
|
Loading…
x
Reference in New Issue
Block a user