Skip to content

Commit

Permalink
refactor - updated dir value
Browse files Browse the repository at this point in the history
  • Loading branch information
rufevean committed Sep 9, 2024
1 parent 6165b3d commit 652da2a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,11 @@ impl Config {
if !err.is_empty() {
eprint!("{err}");
}
Ok(parsed_config.to_parsed_config(
style_edition,
edition,
version,
file_path.parent().unwrap_or(Path::new("")),
))
let dir = file_path.parent().ok_or_else(|| {
format!("failed to get parent directory for {}", file_path.display())
})?;

Ok(parsed_config.to_parsed_config(style_edition, edition, version, dir))
}
Err(e) => {
let err_msg = format!(
Expand Down

0 comments on commit 652da2a

Please sign in to comment.