mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 15:31:07 +00:00
Less horrible logic for missing fields that unconditionally return error
This commit is contained in:
@@ -738,6 +738,16 @@ pub enum Default {
|
||||
Path(syn::ExprPath),
|
||||
}
|
||||
|
||||
impl Default {
|
||||
#[cfg(feature = "deserialize_in_place")]
|
||||
pub fn is_none(&self) -> bool {
|
||||
match *self {
|
||||
Default::None => true,
|
||||
Default::Default | Default::Path(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Field {
|
||||
/// Extract out the `#[serde(...)]` attributes from a struct field.
|
||||
pub fn from_ast(
|
||||
|
||||
Reference in New Issue
Block a user