Skip to content

Commit

Permalink
use serde transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogapod committed Feb 10, 2024
1 parent 619b3ef commit f392aae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
//!
//! // Deserialize is only required with `deserialize` crate feature
//! #[derive(Clone, Debug, serde::Deserialize)]
//! // transparent allows using `true` directly instead of `(true)`
//! #[serde(transparent)]
//! pub struct StringCase(bool);
//!
//! // `typetag` is only required with `deserialize` crate feature
Expand Down Expand Up @@ -87,8 +89,8 @@
//! r#"
//! (
//! patterns: {
//! "a": {"StringCase": (true)},
//! "b": {"StringCase": (false)},
//! "a": {"StringCase": true},
//! "b": {"StringCase": false},
//! }
//! )
//! "#,
Expand Down

0 comments on commit f392aae

Please sign in to comment.