mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-30 03:57:55 +00:00
Add #[serde(rename_all_fields = "foo")] attribute
This commit is contained in:
@@ -112,6 +112,14 @@ impl RenameRule {
|
||||
ScreamingKebabCase => ScreamingSnakeCase.apply_to_field(field).replace('_', "-"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the `RenameRule` if it is not `None`, `rule_b` otherwise.
|
||||
pub fn or(&self, rule_b: &Self) -> Self {
|
||||
match self {
|
||||
None => *rule_b,
|
||||
_ => *self,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ParseError<'a> {
|
||||
|
||||
Reference in New Issue
Block a user