From 6e5510e73897874fabc6915ea5a1b4191ca5f587 Mon Sep 17 00:00:00 2001 From: liukaijie Date: Tue, 26 Sep 2023 17:55:10 +0800 Subject: [PATCH] Fix: `#[serde(default)]` can only be used on structs --- dubbo-build/src/prost.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-build/src/prost.rs b/dubbo-build/src/prost.rs index 1cd92f66..83864695 100644 --- a/dubbo-build/src/prost.rs +++ b/dubbo-build/src/prost.rs @@ -94,7 +94,7 @@ impl Builder { }; config.out_dir(out_dir); config.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]"); - config.type_attribute(".", "#[serde(default)]"); + config.message_attribute(".", "#[serde(default)]"); if self.compile_well_known_types { config.compile_well_known_types();