Refactor.

This commit is contained in:
Stephen Chung
2022-09-25 12:24:03 +08:00
parent def1a683ef
commit b56a9c22f3
20 changed files with 55 additions and 16 deletions

View File

@@ -10,7 +10,7 @@ fn test_max_operations() -> Result<(), Box<EvalAltResult>> {
engine.on_progress(|count| {
if count % 100 == 0 {
println!("{}", count);
println!("{count}");
}
None
});
@@ -68,7 +68,7 @@ fn test_max_operations_functions() -> Result<(), Box<EvalAltResult>> {
engine.on_progress(|count| {
if count % 100 == 0 {
println!("{}", count);
println!("{count}");
}
None
});
@@ -124,7 +124,7 @@ fn test_max_operations_eval() -> Result<(), Box<EvalAltResult>> {
engine.on_progress(|count| {
if count % 100 == 0 {
println!("{}", count);
println!("{count}");
}
None
});

View File

@@ -42,7 +42,7 @@ mod test {
#[rhai_fn(name = "no_effect", set = "no_effect", pure)]
pub fn no_effect(array: &mut Array, value: INT) {
// array is not modified
println!("Array = {:?}, Value = {}", array, value);
println!("Array = {array:?}, Value = {value}");
}
}
}

View File

@@ -66,7 +66,7 @@ fn test_print_debug() -> Result<(), Box<EvalAltResult>> {
);
for entry in logbook.read().unwrap().iter() {
println!("{}", entry);
println!("{entry}");
}
Ok(())

View File

@@ -820,6 +820,6 @@ fn test_serde_blob() -> Result<(), Box<EvalAltResult>> {
#[cfg(not(feature = "no_object"))]
fn test_serde_json_borrowed_string() {
let value = json!({ "a": "b" });
println!("value: {:?}", value);
println!("value: {value:?}");
let _: Dynamic = serde_json::from_value(value).unwrap();
}

View File

@@ -140,7 +140,7 @@ fn test_scope_eval() -> Result<(), Box<EvalAltResult>> {
// Second invocation using the same state
let result = engine.eval_with_scope::<INT>(&mut scope, "x")?;
println!("result: {}", result); // should print 966
println!("result: {result}"); // should print 966
// Variable y is changed in the script
assert_eq!(