Replace String::from("...") with "...".into().

This commit is contained in:
Stephen Chung 2021-02-26 11:21:05 +08:00
parent 2f78626a21
commit 6aa0be546f
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ fn test_side_effects_command() -> Result<(), Box<EvalAltResult>> {
#[test]
fn test_side_effects_print() -> Result<(), Box<EvalAltResult>> {
let result = Arc::new(RwLock::new(String::from("")));
let result = Arc::new(RwLock::new(String::new()));
let mut engine = Engine::new();

View File

@ -53,8 +53,8 @@ fn test_string() -> Result<(), Box<EvalAltResult>> {
fn test_string_dynamic() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
let mut scope = Scope::new();
scope.push("x", Dynamic::from("foo"));
scope.push("y", String::from("foo"));
scope.push("x", "foo");
scope.push("y", "foo");
scope.push("z", "foo");
assert!(engine.eval_with_scope::<bool>(&mut scope, r#"x == "foo""#)?);