Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mantono committed Jan 18, 2024
1 parent 9423836 commit cd41a98
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ impl Args {

fn read_sys_envs() -> Result<Vec<Property>, ParsePropertyError> {
std::env::vars()
.into_iter()
.map(Property::try_from)
.map(|res| res.map(|prop| prop.with_source(prop::Source::EnvVar)))
.collect()
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Display for FireError {
FireError::GenericIO(err) => format!("IO error: {err}"),
FireError::NotAFile(path) => format!("{:?} exists but it is not a file", path.clone()),
FireError::NoReadPermission(path) => format!("No permission to read file {:?}", path.clone()),
FireError::TemplateRendering => format!("Unable to render request from template"),
FireError::TemplateRendering => String::from("Unable to render request from template"),
FireError::TemplateKey(key) => format!("Unable to render request due to missing value for key {key}"),
FireError::Other(err) => format!("Error: {err}"),
};
Expand Down
1 change: 0 additions & 1 deletion src/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub fn from_file(path: &Path) -> Result<Vec<Property>, ParsePropertyError> {

content
.lines()
.into_iter()
.map(Property::from_str)
.map(|prop| prop.map(|p| p.with_source(source)))
.collect()
Expand Down
9 changes: 2 additions & 7 deletions src/template.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use handlebars::RenderError;
use handlebars::{no_escape, Handlebars};
use std::collections::HashMap;
use std::collections::HashSet;
use termcolor::ColorChoice;

use crate::{prop::Property, templ};

Expand All @@ -27,11 +25,8 @@ fn resolve_values(
keys: HashSet<String>,
vars: HashMap<String, String>,
) -> Result<HashMap<String, String>, SubstitutionError> {
let diff: HashSet<String> = keys
.difference(&vars.clone().into_keys().collect())
.into_iter()
.map(|x| x.clone())
.collect();
let diff: HashSet<String> =
keys.difference(&vars.clone().into_keys().collect()).cloned().collect();

if diff.is_empty() {
Ok(vars)
Expand Down

0 comments on commit cd41a98

Please sign in to comment.