File tree 1 file changed +11
-14
lines changed
1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -16,20 +16,17 @@ pub fn wrap_in_const(
16
16
Span :: call_site ( ) ,
17
17
) ;
18
18
19
- let use_serde = serde_path
20
- . map ( |path| {
21
- quote ! {
22
- use #path as _serde;
23
- }
24
- } )
25
- . unwrap_or_else ( || {
26
- quote ! {
27
- #[ allow( unknown_lints) ]
28
- #[ cfg_attr( feature = "cargo-clippy" , allow( useless_attribute) ) ]
29
- #[ allow( rust_2018_idioms) ]
30
- extern crate serde as _serde;
31
- }
32
- } ) ;
19
+ let use_serde = match serde_path {
20
+ Some ( path) => quote ! {
21
+ use #path as _serde;
22
+ } ,
23
+ None => quote ! {
24
+ #[ allow( unknown_lints) ]
25
+ #[ cfg_attr( feature = "cargo-clippy" , allow( useless_attribute) ) ]
26
+ #[ allow( rust_2018_idioms) ]
27
+ extern crate serde as _serde;
28
+ } ,
29
+ } ;
33
30
34
31
quote ! {
35
32
#[ allow( non_upper_case_globals, unused_attributes, unused_qualifications) ]
You can’t perform that action at this time.
0 commit comments