Skip to content

Commit

Permalink
use inlined One/Many
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jun 15, 2023
1 parent b50e6fb commit d022f01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions martin/src/file_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::config::{copy_unrecognized_config, Unrecognized};
use crate::file_config::FileError::{InvalidFilePath, InvalidSourceFilePath, IoError};
use crate::source::{Source, Sources, Xyz};
use crate::utils::{sorted_opt_map, Error, IdResolver, OneOrMany};
use crate::OneOrMany::{Many, One};

#[derive(thiserror::Error, Debug)]
pub enum FileError {
Expand Down Expand Up @@ -43,11 +44,11 @@ impl FileConfigEnum {
pub fn extract_file_config(&mut self) -> FileConfig {
match self {
FileConfigEnum::Path(path) => FileConfig {
paths: Some(OneOrMany::One(mem::take(path))),
paths: Some(One(mem::take(path))),
..FileConfig::default()
},
FileConfigEnum::Paths(paths) => FileConfig {
paths: Some(OneOrMany::Many(mem::take(paths))),
paths: Some(Many(mem::take(paths))),
..Default::default()
},
FileConfigEnum::Config(cfg) => mem::take(cfg),
Expand Down

0 comments on commit d022f01

Please sign in to comment.