Skip to content

Commit

Permalink
Avoid an unwrap call
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Dec 22, 2021
1 parent 5847b85 commit 7b34de1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ impl Opt {
}

pub fn find_amber_yaml_or_default(&mut self) -> &Path {
if self.amber_yaml.is_none() {
self.amber_yaml = Some(Path::new(DEFAULT_AMBER_YAML).to_owned());
}

self.amber_yaml.as_deref().unwrap()
self.amber_yaml
.get_or_insert_with(|| Path::new(DEFAULT_AMBER_YAML).to_owned())
}
}

0 comments on commit 7b34de1

Please sign in to comment.