resolve clippy lints

This commit is contained in:
ConnorSkees 2020-06-26 06:12:50 -04:00
parent 6baf0d2340
commit 9212ff5fa1
3 changed files with 12 additions and 12 deletions

View File

@ -126,7 +126,7 @@ mod unit;
mod utils;
mod value;
fn raw_to_parse_error(map: &CodeMap, err: Box<Error>) -> Box<Error> {
fn raw_to_parse_error(map: &CodeMap, err: Error) -> Box<Error> {
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<String> {
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<String> {
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<String, JsValue> {
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())?)
}

View File

@ -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) => {

View File

@ -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,