Fix defaults for section-order (#4003)

This commit is contained in:
Charlie Marsh 2023-04-17 23:00:17 -04:00 committed by GitHub
parent 79c47e29ee
commit 064a293b80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,7 +348,9 @@ impl Default for Settings {
impl From<Options> for Settings {
fn from(options: Options) -> Self {
// Extract any configuration options that deal with user-defined sections.
let mut section_order: Vec<_> = options.section_order.unwrap_or_default();
let mut section_order: Vec<_> = options
.section_order
.unwrap_or_else(|| ImportType::iter().map(ImportSection::Known).collect());
let known_first_party = options.known_first_party.unwrap_or_default();
let known_third_party = options.known_third_party.unwrap_or_default();
let known_local_folder = options.known_local_folder.unwrap_or_default();