From 906106fdf038b1a5a54bc56eddbfbab3c0cd0f49 Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Wed, 15 Sep 2021 09:10:30 +0200 Subject: [PATCH] refactor: field `origins_str` is never read on cors module --- src/cors.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cors.rs b/src/cors.rs index 0992a46..5bc48fa 100644 --- a/src/cors.rs +++ b/src/cors.rs @@ -11,13 +11,12 @@ pub struct Cors { allowed_headers: HashSet, max_age: Option, allowed_methods: HashSet, - origins_str: String, origins: Option>, } /// It builds a new CORS instance. pub fn new(origins_str: String) -> Option> { - let cors = Cors::new(origins_str.clone()); + let cors = Cors::new(); let cors = if origins_str.is_empty() { None } else if origins_str == "*" { @@ -41,13 +40,12 @@ pub fn new(origins_str: String) -> Option> { impl Cors { /// Creates a new Cors instance. - pub fn new(origins_str: String) -> Self { + pub fn new() -> Self { Self { origins: None, allowed_headers: HashSet::new(), allowed_methods: HashSet::new(), max_age: None, - origins_str, } } @@ -121,7 +119,7 @@ impl Cors { impl Default for Cors { fn default() -> Self { - Self::new("*".to_owned()) + Self::new() } } -- libgit2 1.7.2