From 6aa0be546fe897ccaa6c91f529a4c9340ab4cb45 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 26 Feb 2021 11:21:05 +0800 Subject: [PATCH] Replace String::from("...") with "...".into(). --- tests/side_effects.rs | 2 +- tests/string.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/side_effects.rs b/tests/side_effects.rs index 69e33de1..b7ba49f6 100644 --- a/tests/side_effects.rs +++ b/tests/side_effects.rs @@ -66,7 +66,7 @@ fn test_side_effects_command() -> Result<(), Box> { #[test] fn test_side_effects_print() -> Result<(), Box> { - let result = Arc::new(RwLock::new(String::from(""))); + let result = Arc::new(RwLock::new(String::new())); let mut engine = Engine::new(); diff --git a/tests/string.rs b/tests/string.rs index 6880c195..a4f80c07 100644 --- a/tests/string.rs +++ b/tests/string.rs @@ -53,8 +53,8 @@ fn test_string() -> Result<(), Box> { fn test_string_dynamic() -> Result<(), Box> { 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::(&mut scope, r#"x == "foo""#)?);