From 9212ff5fa1d16272e3f5a914ee59225b7d275f99 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Fri, 26 Jun 2020 06:12:50 -0400 Subject: [PATCH] resolve clippy lints --- src/lib.rs | 20 ++++++++++---------- src/output.rs | 2 +- src/value/mod.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 45d2d99..d1e89f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,7 +126,7 @@ mod unit; mod utils; mod value; -fn raw_to_parse_error(map: &CodeMap, err: Box) -> Box { +fn raw_to_parse_error(map: &CodeMap, err: Error) -> Box { let (message, span) = err.raw(); Box::new(Error::from_loc(message, map.look_up_span(span))) } @@ -168,12 +168,12 @@ pub fn from_path(p: &str) -> Result { extender: &mut extender, } .parse() - .map_err(|e| raw_to_parse_error(&map, e))?, + .map_err(|e| raw_to_parse_error(&map, *e))?, &mut extender, ) - .map_err(|e| raw_to_parse_error(&map, e))? + .map_err(|e| raw_to_parse_error(&map, *e))? .pretty_print(&map, &mut extender) - .map_err(|e| raw_to_parse_error(&map, e)) + .map_err(|e| raw_to_parse_error(&map, *e)) } /// Write CSS to `buf`, constructed from a string @@ -214,12 +214,12 @@ pub fn from_string(p: String) -> Result { extender: &mut extender, } .parse() - .map_err(|e| raw_to_parse_error(&map, e))?, + .map_err(|e| raw_to_parse_error(&map, *e))?, &mut extender, ) - .map_err(|e| raw_to_parse_error(&map, e))? + .map_err(|e| raw_to_parse_error(&map, *e))? .pretty_print(&map, &mut extender) - .map_err(|e| raw_to_parse_error(&map, e)) + .map_err(|e| raw_to_parse_error(&map, *e)) } #[cfg(feature = "wasm")] @@ -250,10 +250,10 @@ pub fn from_string(p: String) -> std::result::Result { extender: &mut extender, } .parse() - .map_err(|e| raw_to_parse_error(&map, e).to_string())?, + .map_err(|e| raw_to_parse_error(&map, *e).to_string())?, &mut extender, ) - .map_err(|e| raw_to_parse_error(&map, e).to_string())? + .map_err(|e| raw_to_parse_error(&map, *e).to_string())? .pretty_print(&map, &mut extender) - .map_err(|e| raw_to_parse_error(&map, e).to_string())?) + .map_err(|e| raw_to_parse_error(&map, *e).to_string())?) } diff --git a/src/output.rs b/src/output.rs index 13c500c..af69731 100644 --- a/src/output.rs +++ b/src/output.rs @@ -103,7 +103,7 @@ impl Css { vals.push(Toplevel::Media { query, body }) } Stmt::Supports(s) => { - let SupportsRule { params, body, .. } = *s; + let SupportsRule { params, body } = *s; vals.push(Toplevel::Supports { params, body }) } Stmt::UnknownAtRule(u) => { diff --git a/src/value/mod.rs b/src/value/mod.rs index b9bbaf6..9401161 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -353,7 +353,7 @@ impl Value { global_scope: parser.global_scope, super_selectors: parser.super_selectors, span_before: parser.span_before, - content: parser.content.clone(), + content: parser.content, in_mixin: parser.in_mixin, in_function: parser.in_function, in_control_flow: parser.in_control_flow,