diff --git a/serde_codegen/src/attr.rs b/serde_codegen/src/attr.rs index fa64d6cf..8f41022a 100644 --- a/serde_codegen/src/attr.rs +++ b/serde_codegen/src/attr.rs @@ -30,11 +30,6 @@ impl Name { } } - /// Return the string expression of the field ident. - pub fn ident_expr(&self) -> P { - AstBuilder::new().expr().str(self.ident) - } - /// Return the container name for the container when serializing. pub fn serialize_name(&self) -> InternedString { match self.serialize_name { @@ -310,7 +305,7 @@ impl FieldAttrs { match self.default_expr_if_missing { Some(ref expr) => expr.clone(), None => { - let name = self.name.ident_expr(); + let name = self.name.deserialize_name_expr(); AstBuilder::new().expr() .try() .method_call("missing_field").id("visitor")