Skip to content

Commit

Permalink
some clippy things
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Dec 23, 2024
1 parent 2e8ef9a commit e95dab8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/compile_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use xshell::{cmd, Shell};
fn fixed_cost_compile_times() {
let mut sh = Shell::new().unwrap();

let _p = sh.set_current_dir("tests/data");
sh.set_current_dir("tests/data");
let baseline = compile_bench(&mut sh, "baseline");
let _ducted = compile_bench(&sh, "ducted");
let xshelled = compile_bench(&mut sh, "xshelled");
Expand Down
8 changes: 4 additions & 4 deletions tests/it/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fn test_env() {
);
}

let _g1 = sh.set_var(v1, "foobar");
let _g2 = sh.set_var(v2, "quark");
sh.set_var(v1, "foobar");
sh.set_var(v2, "quark");

assert_env(cmd!(sh, "xecho -$ {v1} {v2}"), &[(v1, Some("foobar")), (v2, Some("quark"))]);
assert_env(cmd!(cloned_sh, "xecho -$ {v1} {v2}"), &[(v1, None), (v2, None)]);
Expand Down Expand Up @@ -79,8 +79,8 @@ fn test_env_clear() {
&[(v1, Some("789")), (v2, None)],
);

let _g1 = sh.set_var(v1, "foobar");
let _g2 = sh.set_var(v2, "quark");
sh.set_var(v1, "foobar");
sh.set_var(v2, "quark");

assert_env(cmd!(sh, "{xecho} -$ {v1} {v2}").env_clear(), &[(v1, None), (v2, None)]);
assert_env(
Expand Down
6 changes: 3 additions & 3 deletions tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ fn test_subshells_env() {
assert_eq!(e2.as_deref(), Some("1".as_ref()));
{
let mut sh = sh.clone();
let _e = sh.set_var(VAR, "2");
sh.set_var(VAR, "2");
let e3 = sh.var_os(VAR);
assert_eq!(e3.as_deref(), Some("2".as_ref()));
}
Expand Down Expand Up @@ -383,14 +383,14 @@ fn test_copy_file() {
fn test_exists() {
let mut sh = setup();
let tmp = sh.create_temp_dir().unwrap();
let _d = sh.set_current_dir(tmp.path());
sh.set_current_dir(tmp.path());
assert!(!sh.path_exists("foo.txt"));
sh.write_file("foo.txt", "foo").unwrap();
assert!(sh.path_exists("foo.txt"));
assert!(!sh.path_exists("bar"));
sh.create_dir("bar").unwrap();
assert!(sh.path_exists("bar"));
let _d = sh.set_current_dir("bar");
sh.set_current_dir("bar");
assert!(!sh.path_exists("quz.rs"));
sh.write_file("quz.rs", "fn main () {}").unwrap();
assert!(sh.path_exists("quz.rs"));
Expand Down

0 comments on commit e95dab8

Please sign in to comment.