Skip to content

Commit 66e6a66

Browse files
committed
Resolve compiler warnings in expression tests
1 parent 8bd404b commit 66e6a66

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

esi/src/expression.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -971,26 +971,26 @@ mod tests {
971971
}
972972
#[test]
973973
fn test_eval_matches_with_captures() -> Result<()> {
974-
let mut ctx =
974+
let ctx =
975975
&mut EvalContext::from([("hello".to_string(), Value::String("foobar".to_string()))]);
976976

977-
let result = evaluate_expression("$(hello) matches '^(fo)o'", &mut ctx)?;
977+
let result = evaluate_expression("$(hello) matches '^(fo)o'", ctx)?;
978978
assert_eq!(result, Value::Boolean(BoolValue::True));
979979

980-
let result = evaluate_expression("$(MATCHES{1})", &mut ctx)?;
980+
let result = evaluate_expression("$(MATCHES{1})", ctx)?;
981981
assert_eq!(result, Value::String("fo".to_string()));
982982
Ok(())
983983
}
984984
#[test]
985985
fn test_eval_matches_with_captures_and_match_name() -> Result<()> {
986-
let mut ctx =
986+
let ctx =
987987
&mut EvalContext::from([("hello".to_string(), Value::String("foobar".to_string()))]);
988988

989989
ctx.set_match_name("my_custom_name");
990990
let result = evaluate_expression("$(hello) matches '^(fo)o'", ctx)?;
991991
assert_eq!(result, Value::Boolean(BoolValue::True));
992992

993-
let result = evaluate_expression("$(my_custom_name{1})", &mut ctx)?;
993+
let result = evaluate_expression("$(my_custom_name{1})", ctx)?;
994994
assert_eq!(result, Value::String("fo".to_string()));
995995
Ok(())
996996
}
@@ -1128,13 +1128,13 @@ mod tests {
11281128

11291129
#[test]
11301130
fn test_bool_coercion() -> Result<()> {
1131-
assert_eq!(Value::Boolean(BoolValue::True).to_bool(), true);
1132-
assert_eq!(Value::Boolean(BoolValue::False).to_bool(), false);
1133-
assert_eq!(Value::Integer(1).to_bool(), true);
1134-
assert_eq!(Value::Integer(0).to_bool(), false);
1135-
assert_eq!(Value::String("".to_string()).to_bool(), false);
1136-
assert_eq!(Value::String("hello".to_string()).to_bool(), true);
1137-
assert_eq!(Value::Null.to_bool(), false);
1131+
assert!(Value::Boolean(BoolValue::True).to_bool());
1132+
assert!(!Value::Boolean(BoolValue::False).to_bool());
1133+
assert!(Value::Integer(1).to_bool());
1134+
assert!(!Value::Integer(0).to_bool());
1135+
assert!(!Value::String("".to_string()).to_bool());
1136+
assert!(Value::String("hello".to_string()).to_bool());
1137+
assert!(!Value::Null.to_bool());
11381138

11391139
Ok(())
11401140
}

0 commit comments

Comments
 (0)