Skip to content

Commit

Permalink
fix: provided directory is either .d for tdf or anything for minitdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-wehner-bruker committed Nov 6, 2023
1 parent 09fa88d commit 58589bd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/file_readers/file_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ impl FileFormat {
.unwrap_or_default();
let format = match extension {
"d" => Self::DFolder(path),
"ms2" => Self::MS2Folder(path),
_ => {
if let Some(path) = path.parent() {
// Only recurse if there is a valid parent section,
// otherwise we'll get a stack overflow
return Self::parse(path);
}
return Err(FileFormatError::NoParentWithBrukerExtension);
},
_ => Self::MS2Folder(path)
};
format.is_valid()?;
Ok(format)
Expand Down

0 comments on commit 58589bd

Please sign in to comment.