diff --git a/pilota-build/src/plugin/mod.rs b/pilota-build/src/plugin/mod.rs index 3173a77..ffb4450 100644 --- a/pilota-build/src/plugin/mod.rs +++ b/pilota-build/src/plugin/mod.rs @@ -357,7 +357,7 @@ impl Plugin for ImplDefaultPlugin { } format!("{name}: {val}") } else { - format!("{name}: Default::default()") + format!("{name}: ::std::default::Default::default()") } }) .join(",\n"); @@ -373,7 +373,7 @@ impl Plugin for ImplDefaultPlugin { adj.add_nested_item( format!( r#" - impl Default for {name} {{ + impl ::std::default::Default for {name} {{ fn default() -> Self {{ {name} {{ {fields} diff --git a/pilota-build/test_data/thrift/apache.rs b/pilota-build/test_data/thrift/apache.rs index 540b378..6a10a3a 100644 --- a/pilota-build/test_data/thrift/apache.rs +++ b/pilota-build/test_data/thrift/apache.rs @@ -1423,7 +1423,7 @@ pub mod apache { } } pub const MY_NUMBERZ: Numberz = Numberz::ONE; - impl Default for BoolTest { + impl ::std::default::Default for BoolTest { fn default() -> Self { BoolTest { b: Some(true), @@ -5269,7 +5269,7 @@ pub mod apache { + __protocol.struct_end_len() } } - impl Default for OptionalBinary { + impl ::std::default::Default for OptionalBinary { fn default() -> Self { OptionalBinary { bin_map: Some({ @@ -20765,7 +20765,7 @@ pub mod apache { ) } } - impl Default for OptionalSetDefaultTest { + impl ::std::default::Default for OptionalSetDefaultTest { fn default() -> Self { OptionalSetDefaultTest { with_default: Some(::pilota::AHashSet::from([ diff --git a/pilota-build/test_data/thrift/default_value.rs b/pilota-build/test_data/thrift/default_value.rs index 898d1e9..9e2f481 100644 --- a/pilota-build/test_data/thrift/default_value.rs +++ b/pilota-build/test_data/thrift/default_value.rs @@ -91,7 +91,7 @@ pub mod default_value { __protocol.i32_len(self.inner()) } } - impl Default for C { + impl ::std::default::Default for C { fn default() -> Self { C { off: Some(::pilota::FastStr::from_static_str("off")), @@ -266,7 +266,7 @@ pub mod default_value { + __protocol.struct_end_len() } } - impl Default for A { + impl ::std::default::Default for A { fn default() -> Self { A { faststr: ::pilota::FastStr::from_static_str("hello world"), diff --git a/pilota-build/test_data/thrift/multi.rs b/pilota-build/test_data/thrift/multi.rs index 0b0ee0a..d26f390 100644 --- a/pilota-build/test_data/thrift/multi.rs +++ b/pilota-build/test_data/thrift/multi.rs @@ -3,7 +3,7 @@ pub mod multi { pub mod default_value { - impl Default for C { + impl ::std::default::Default for C { fn default() -> Self { C { off: Some(::pilota::FastStr::from_static_str("off")), @@ -268,7 +268,7 @@ pub mod multi { __protocol.i32_len(self.inner()) } } - impl Default for A { + impl ::std::default::Default for A { fn default() -> Self { A { faststr: ::pilota::FastStr::from_static_str("hello world"), @@ -949,7 +949,7 @@ pub mod multi { pub mod multi { - impl Default for A { + impl ::std::default::Default for A { fn default() -> Self { A { c: Some(super::default_value::C {