Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrodger committed Jul 12, 2020
1 parent caf9cab commit 06367d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl ConfigurationStore {
let src = self
.configurations
.get(src_name)
.ok_or(Error::UnknownConfiguration(src_name.to_owned()))?;
.ok_or_else(|| Error::UnknownConfiguration(src_name.to_owned()))?;

if !Configuration::is_valid_name(dest_name) {
bail!(Error::InvalidName(dest_name.to_owned()));
Expand Down Expand Up @@ -247,7 +247,7 @@ impl ConfigurationStore {
pub fn describe(&self, name: &str) -> Result<Properties> {
let configuration = self
.find_by_name(name)
.ok_or(Error::UnknownConfiguration(name.to_owned()))?;
.ok_or_else(|| Error::UnknownConfiguration(name.to_owned()))?;

let path = &configuration.path;
let handle = File::open(path).with_context(|| format!("Opening file {:?}", path))?;
Expand All @@ -263,7 +263,7 @@ impl ConfigurationStore {
let src = self
.configurations
.get(old_name)
.ok_or(Error::UnknownConfiguration(old_name.to_owned()))?;
.ok_or_else(|| Error::UnknownConfiguration(old_name.to_owned()))?;

let active = self.is_active(&src);

Expand Down

0 comments on commit 06367d9

Please sign in to comment.