Skip to content

Commit

Permalink
Several clippy-driven fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Nov 5, 2024
1 parent 67d24ce commit 10da73c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions jump/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,15 +721,15 @@ mod tests {
assert_eq!(
("".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__}")
.reify_string(&env, "{scie.env.__DNE__}")
.unwrap()
);

env.clear();
assert_eq!(
("default".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__=default}")
.reify_string(&env, "{scie.env.__DNE__=default}")
.unwrap()
);

Expand All @@ -738,15 +738,15 @@ mod tests {
assert_eq!(
("foo".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__=default}")
.reify_string(&env, "{scie.env.__DNE__=default}")
.unwrap()
);

env.clear();
assert_eq!(
("scie_path".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__={scie}}")
.reify_string(&env, "{scie.env.__DNE__={scie}}")
.unwrap()
);

Expand All @@ -763,7 +763,7 @@ mod tests {
.unwrap(),
false
),
context.reify_string(&mut env, "{scie.base}").unwrap()
context.reify_string(&env, "{scie.base}").unwrap()
);
assert_eq!(
(
Expand All @@ -776,7 +776,7 @@ mod tests {
true
),
context
.reify_string(&mut env, "{scie.env.__DNE__={scie.lift}}")
.reify_string(&env, "{scie.env.__DNE__={scie.lift}}")
.unwrap()
);

Expand All @@ -802,15 +802,15 @@ mod tests {
false
),
context
.reify_string(&mut env, "{scie.env.__DNE__={file}}")
.reify_string(&env, "{scie.env.__DNE__={file}}")
.unwrap()
);

env.clear();
assert_eq!(
("42".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__={scie.env.__DNE2__=42}}")
.reify_string(&env, "{scie.env.__DNE__={scie.env.__DNE2__=42}}")
.unwrap()
);

Expand All @@ -819,7 +819,7 @@ mod tests {
assert_eq!(
("bar".to_string(), false),
context
.reify_string(&mut env, "{scie.env.__DNE__={scie.env.__DNE2__=42}}")
.reify_string(&env, "{scie.env.__DNE__={scie.env.__DNE2__=42}}")
.unwrap()
);
}
Expand Down Expand Up @@ -899,7 +899,7 @@ mod tests {
],
};

let process = context.prepare_process(&cmd).unwrap();
let process = context.prepare_process(cmd).unwrap();
assert_eq!(
Process {
env: expected_env.clone(),
Expand All @@ -913,7 +913,7 @@ mod tests {
);

env::set_var("SELECT", "v1");
let process = context.prepare_process(&cmd).unwrap();
let process = context.prepare_process(cmd).unwrap();
assert_eq!(
Process {
env: expected_env.clone(),
Expand All @@ -928,7 +928,7 @@ mod tests {
env::remove_var("SELECT");

env::set_var("SELECT", "v2");
let process = context.prepare_process(&cmd).unwrap();
let process = context.prepare_process(cmd).unwrap();
assert_eq!(
Process {
env: expected_env,
Expand Down Expand Up @@ -1001,7 +1001,7 @@ mod tests {

let cmd = lift.boot.commands.get("").unwrap();

let process = context.prepare_process(&cmd).unwrap();
let process = context.prepare_process(cmd).unwrap();
let reified_path = format!("c:e:{}", env::var("PATH").unwrap());
assert_eq!(
Process {
Expand All @@ -1021,7 +1021,7 @@ mod tests {
);

env::set_var("D", "d");
let process = context.prepare_process(&cmd).unwrap();
let process = context.prepare_process(cmd).unwrap();
let reified_path = format!("d:e:{}", env::var("PATH").unwrap());
assert_eq!(
Process {
Expand Down
4 changes: 2 additions & 2 deletions jump/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ mod tests {

fn with_env<T>(func: T)
where
T: FnOnce() -> (),
T: FnOnce(),
{
let _env_lock = ENV_LOCK
.get_or_init(|| Arc::new(ReentrantMutex::new(())))
Expand All @@ -228,7 +228,7 @@ mod tests {

fn with_extra_env<T>(extra_env: &[(OsString, OsString)], func: T)
where
T: FnOnce() -> (),
T: FnOnce(),
{
with_env(|| {
let mut original_env = vec![];
Expand Down

0 comments on commit 10da73c

Please sign in to comment.