File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ pub struct StructField {
8585
8686impl StructField {
8787 /// Assemble the current options into a rust type, like `base_type: String, is_optional: true` to `Option<String>`
88- pub fn to_rust_type ( & self ) -> std:: borrow:: Cow < str > {
88+ pub fn to_rust_type ( & self ) -> std:: borrow:: Cow < ' _ , str > {
8989 let mut rust_type = self . base_type . clone ( ) ;
9090
9191 // order matters!
@@ -804,8 +804,13 @@ fn build_default_impl_fn<'a>(
804804 . collect :: < Vec < String > > ( )
805805 . join ( ",\n " ) ;
806806 format ! (
807- "impl Default for {struct_name} {{\n fn default() -> Self {{\n Self {{\n {f2d}\n }}\n }}\n }}" ,
808- struct_name = struct_name, f2d=fields_to_defaults. as_str( )
807+ r#"impl Default for {struct_name} {{
808+ fn default() -> Self {{
809+ Self {{
810+ {fields_to_defaults}
811+ }}
812+ }}
813+ }}"#
809814 )
810815}
811816
You can’t perform that action at this time.
0 commit comments