From 920acb2888e3ebbef09eb7a3bd220b643233e56c Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Thu, 1 Jul 2021 15:46:50 +0200 Subject: [PATCH] refactor: prefer `to_owned()` for string literals over `to_string()` --- src/cors.rs | 2 +- src/helpers.rs | 2 +- src/server.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cors.rs b/src/cors.rs index 2014ce8..0992a46 100644 --- a/src/cors.rs +++ b/src/cors.rs @@ -121,7 +121,7 @@ impl Cors { impl Default for Cors { fn default() -> Self { - Self::new("*".to_string()) + Self::new("*".to_owned()) } } diff --git a/src/helpers.rs b/src/helpers.rs index 63cb0a9..f32ccce 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -22,7 +22,7 @@ where { let path = get_valid_dirpath(path)?; match path.iter().last() { - Some(v) => Ok(v.to_str().unwrap().to_string()), + Some(v) => Ok(v.to_str().unwrap().to_owned()), _ => bail!("directory name for path \"{:?}\" was not determined", path), } } diff --git a/src/server.rs b/src/server.rs index 6308b39..adf6942 100644 --- a/src/server.rs +++ b/src/server.rs @@ -105,7 +105,7 @@ impl Server { let threads = self.threads; // CORS support - let cors = cors::new(opts.cors_allow_origins.trim().to_string()); + let cors = cors::new(opts.cors_allow_origins.trim().to_owned()); // Create a service router for Hyper let router_service = RouterService::new(RequestHandler { -- libgit2 1.7.2