Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 496c892

Browse files
committed
Auto merge of #1540 - Xanewok:fix-crate-blacklist-default, r=Xanewok
Fix inferred crate_blacklist default And here I thought I checked everything... 🤦‍♂️ This fixes the inferred default when passing `"rust.crate_blacklist": null` configuration option
2 parents 7b0a20b + c4e7317 commit 496c892

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

rls/src/config.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,18 @@ impl Config {
273273

274274
/// Join this configuration with the new config.
275275
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);
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+
}
281281

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());
282288
*self = new;
283289
}
284290

0 commit comments

Comments
 (0)