File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use std:: cell:: OnceCell ;
2-
31use darling:: util:: Flag ;
42use darling:: FromMeta ;
53use syn:: ExprPath ;
@@ -13,7 +11,7 @@ pub struct FieldAttributes {
1311impl FieldAttributes {
1412 fn new ( internal : InternalFieldAttributes ) -> darling:: Result < Self > {
1513 let mut skip_mode = SkipMode :: Default ;
16- let debug_format = OnceCell :: new ( ) ;
14+ let mut debug_format = DebugFormat :: Default ;
1715
1816 if internal. skip . is_present ( ) {
1917 skip_mode = skip_mode. try_combine ( SkipMode :: Always ) ?;
@@ -24,19 +22,13 @@ impl FieldAttributes {
2422 }
2523
2624 if let Some ( format) = internal. format {
27- debug_format
28- . set ( DebugFormat :: Format ( format) )
29- . map_err ( |_| conflicting_format_options_error ( ) ) ?;
25+ debug_format = debug_format. try_combine ( DebugFormat :: Format ( format) ) ?;
3026 }
3127
3228 if let Some ( with) = internal. with {
33- debug_format
34- . set ( DebugFormat :: With ( with) )
35- . map_err ( |_| conflicting_format_options_error ( ) ) ?;
29+ debug_format = debug_format. try_combine ( DebugFormat :: With ( with) ) ?;
3630 }
3731
38- let debug_format = debug_format. into_inner ( ) . unwrap_or ( DebugFormat :: Default ) ;
39-
4032 Ok ( Self {
4133 skip_mode,
4234 debug_format,
You can’t perform that action at this time.
0 commit comments