This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -273,14 +273,18 @@ impl Config {
273
273
274
274
/// Join this configuration with the new config.
275
275
pub fn update ( & mut self , mut new : Config ) {
276
- new. normalise ( ) ;
277
- new. target_dir = self . target_dir . combine_with_default ( & new. target_dir , None ) ;
278
- new. build_lib = self . build_lib . combine_with_default ( & new. build_lib , false ) ;
279
- new. build_bin = self . build_bin . combine_with_default ( & new. build_bin , None ) ;
280
- new. full_docs = self . full_docs . combine_with_default ( & new. full_docs , false ) ;
281
- new. crate_blacklist =
282
- self . crate_blacklist . combine_with_default ( & new. crate_blacklist , Default :: default ( ) ) ;
276
+ macro_rules! combine_option_with_default {
277
+ ( $ident: ident, $val: expr) => {
278
+ new. $ident = self . $ident. combine_with_default( & new. $ident, $val) ;
279
+ } ;
280
+ }
283
281
282
+ new. normalise ( ) ;
283
+ combine_option_with_default ! ( target_dir, None ) ;
284
+ combine_option_with_default ! ( build_lib, false ) ;
285
+ combine_option_with_default ! ( build_bin, None ) ;
286
+ combine_option_with_default ! ( full_docs, false ) ;
287
+ combine_option_with_default ! ( crate_blacklist, CrateBlacklist :: default ( ) ) ;
284
288
* self = new;
285
289
}
286
290
You can’t perform that action at this time.
0 commit comments