File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -369,17 +369,14 @@ fn main() {
369369 // Derive a builder in cases of 2+ parameters.
370370 let mut item_struct = item_struct. clone ( ) ;
371371 item_struct. attrs . push ( parse_quote ! ( #[ derive( bon:: Builder ) ] ) ) ;
372+ item_struct. attrs . push ( parse_quote ! ( #[ builder( on( :: std:: string:: String , into) ) ] ) ) ;
372373 if let syn:: Fields :: Named ( fields) = & mut item_struct. fields {
373374 for field in fields. named . iter_mut ( ) {
374375 let Some ( ident) = & field. ident else { continue } ;
375376 if ident == "message_id" {
376377 // By default, generate message_id
377378 field. attrs . push ( parse_quote ! ( #[ builder( default = Id :: generate( ) ) ] ) ) ;
378379 }
379- if field. ty == parse_quote ! ( String ) || field. ty == parse_quote ! ( Option <String >) {
380- // For strings, take impl Into<String> instead of a regular String
381- field. attrs . push ( parse_quote ! ( #[ builder( into) ] ) ) ;
382- }
383380 }
384381 }
385382
You can’t perform that action at this time.
0 commit comments