Skip to content

Commit

Permalink
Re-format with new rustfmt and fix new clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Trundle committed Feb 12, 2024
1 parent 90a5668 commit b54ba56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ fn main() -> Result<(), Error> {
println!("cargo:rustc-env=RAGENIX_NIX_BIN_PATH={nix_bin_path}");

// Make the paths to the shell completion files available as environment variables
let Some(outdir) = env::var_os("OUT_DIR") else { return Ok(()) };
let Some(outdir) = env::var_os("OUT_DIR") else {
return Ok(());
};

let mut app = build();
app.set_bin_name(crate_name!());
Expand Down
2 changes: 1 addition & 1 deletion src/ragenix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub(crate) fn parse_rules<P: AsRef<Path>>(rules_path: P) -> Result<Vec<RagenixRu

// It's fine to force unwrap here as we validated the JSON schema
let mut rules: Vec<RagenixRule> = Vec::new();
for (rel_path, val) in instance.as_object().unwrap().iter() {
for (rel_path, val) in instance.as_object().unwrap() {
let dir = fs::canonicalize(rules_path.as_ref().parent().unwrap())?;
let p = dir.join(rel_path);
let public_keys = val.as_object().unwrap()["publicKeys"]
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mod test_split_editor {

#[test]
fn parse_editor_complex_2() -> Result<()> {
let actual = split_editor(r#"sed -i 's/.*/ x /'"#)?;
let actual = split_editor(r"sed -i 's/.*/ x /'")?;
let expected = (
String::from("sed"),
Some(vec![String::from("-i"), String::from("s/.*/ x /")]),
Expand All @@ -157,7 +157,7 @@ mod test_split_editor {

#[test]
fn parse_editor_stdin() -> Result<()> {
let actual = split_editor(r#" - "#)?;
let actual = split_editor(r" - ")?;
let expected = (String::from("-"), None);
assert_eq!(actual, expected);
Ok(())
Expand Down

0 comments on commit b54ba56

Please sign in to comment.