make clippy happy
This commit is contained in:
1 parent
e43bdd815f
commit
25f02904e9
6 files changed
+12
-14
No files matched your search
@@ -158,8 +158,13 @@ fn get_mime_from_path(trimmed: &Path) -> Result<&'static str> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let res = match infer::get_from_path(trimmed)?.map(|f| f.mime_type()) {
|
let res = match infer::get_from_path(trimmed)?.map(|f| f.mime_type()) {
|
||||||
Some(t) if t == "text/plain" => get_mime_by_ext(trimmed),
|
Some(f) => {
|
||||||
Some(f) => f,
|
if f == "text/plain" {
|
||||||
|
get_mime_by_ext(trimmed)
|
||||||
|
} else {
|
||||||
|
f
|
||||||
|
}
|
||||||
|
}
|
||||||
None => get_mime_by_ext(trimmed),
|
None => get_mime_by_ext(trimmed),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ pub fn use_eval(cx: &ScopeState) -> &EvalCreator {
|
|||||||
Rc::new(move |script: &str| {
|
Rc::new(move |script: &str| {
|
||||||
eval_provider
|
eval_provider
|
||||||
.new_evaluator(script.to_string())
|
.new_evaluator(script.to_string())
|
||||||
.map(|evaluator| UseEval::new(evaluator))
|
.map(UseEval::new)
|
||||||
}) as Rc<dyn Fn(&str) -> Result<UseEval, EvalError>>
|
}) as Rc<dyn Fn(&str) -> Result<UseEval, EvalError>>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -446,7 +446,6 @@ impl<V: FromAnyValue + Send + Sync> RealDom<V> {
|
|||||||
drop(tree);
|
drop(tree);
|
||||||
children.reverse();
|
children.reverse();
|
||||||
if let Some(node) = self.get_mut(id) {
|
if let Some(node) = self.get_mut(id) {
|
||||||
let node = node;
|
|
||||||
f(node);
|
f(node);
|
||||||
stack.extend(children.iter());
|
stack.extend(children.iter());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,10 +288,7 @@ impl DynamicMapping {
|
|||||||
let idx = self.last_attribute_idx;
|
let idx = self.last_attribute_idx;
|
||||||
self.last_attribute_idx += 1;
|
self.last_attribute_idx += 1;
|
||||||
|
|
||||||
self.attribute_to_idx
|
self.attribute_to_idx.entry(attr).or_default().push(idx);
|
||||||
.entry(attr)
|
|
||||||
.or_insert_with(Vec::new)
|
|
||||||
.push(idx);
|
|
||||||
|
|
||||||
idx
|
idx
|
||||||
}
|
}
|
||||||
@@ -300,10 +297,7 @@ impl DynamicMapping {
|
|||||||
let idx = self.last_element_idx;
|
let idx = self.last_element_idx;
|
||||||
self.last_element_idx += 1;
|
self.last_element_idx += 1;
|
||||||
|
|
||||||
self.node_to_idx
|
self.node_to_idx.entry(node).or_default().push(idx);
|
||||||
.entry(node)
|
|
||||||
.or_insert_with(Vec::new)
|
|
||||||
.push(idx);
|
|
||||||
|
|
||||||
idx
|
idx
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ impl StringCache {
|
|||||||
inner_html = Some(value);
|
inner_html = Some(value);
|
||||||
} else if let Some("style") = namespace {
|
} else if let Some("style") = namespace {
|
||||||
styles.push((name, value));
|
styles.push((name, value));
|
||||||
} else if BOOL_ATTRS.contains(&name) {
|
} else if BOOL_ATTRS.contains(name) {
|
||||||
if str_truthy(value) {
|
if str_truthy(value) {
|
||||||
write!(chain, " {name}=\"{value}\"",)?;
|
write!(chain, " {name}=\"{value}\"",)?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ impl Renderer {
|
|||||||
write_value(buf, &attr.value)?;
|
write_value(buf, &attr.value)?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write_attribute(buf, &attr)?;
|
write_attribute(buf, attr)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Segment::Node(idx) => match &template.dynamic_nodes[*idx] {
|
Segment::Node(idx) => match &template.dynamic_nodes[*idx] {
|
||||||
|
|||||||
Reference in new issue
Block a user