refactor: prefer `to_owned()` for string literals over `to_string()`
Diff
src/cors.rs | 2 +-
src/helpers.rs | 2 +-
src/server.rs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
@@ -121,7 +121,7 @@ impl Cors {
impl Default for Cors {
fn default() -> Self {
Self::new("*".to_string())
Self::new("*".to_owned())
}
}
@@ -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),
}
}
@@ -105,7 +105,7 @@ impl Server {
let threads = self.threads;
let cors = cors::new(opts.cors_allow_origins.trim().to_string());
let cors = cors::new(opts.cors_allow_origins.trim().to_owned());
let router_service = RouterService::new(RequestHandler {