fix clippy
This commit is contained in:
1 parent
d815c7cc89
commit
ff26380838
4 files changed
+4
-8
No files matched your search
@@ -560,7 +560,7 @@ impl<'b> VirtualDom {
|
|||||||
// If none of the old keys are reused by the new children, then we remove all the remaining old children and
|
// If none of the old keys are reused by the new children, then we remove all the remaining old children and
|
||||||
// create the new children afresh.
|
// create the new children afresh.
|
||||||
if shared_keys.is_empty() {
|
if shared_keys.is_empty() {
|
||||||
if old.get(0).is_some() {
|
if old.first().is_some() {
|
||||||
self.remove_nodes(&old[1..]);
|
self.remove_nodes(&old[1..]);
|
||||||
self.replace(&old[0], new);
|
self.replace(&old[0], new);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ mod atoms {
|
|||||||
pub use atom::*;
|
pub use atom::*;
|
||||||
pub use atomfamily::*;
|
pub use atomfamily::*;
|
||||||
pub use atomref::*;
|
pub use atomref::*;
|
||||||
pub use selector::*;
|
|
||||||
pub use selectorfamily::*;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod hooks {
|
pub mod hooks {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
|||||||
fn to_tokens(&self, out_tokens: &mut TokenStream2) {
|
fn to_tokens(&self, out_tokens: &mut TokenStream2) {
|
||||||
let mut context = DynamicContext::default();
|
let mut context = DynamicContext::default();
|
||||||
|
|
||||||
let key = match self.roots.get(0) {
|
let key = match self.roots.first() {
|
||||||
Some(BodyNode::Element(el)) if self.roots.len() == 1 => el.key.clone(),
|
Some(BodyNode::Element(el)) if self.roots.len() == 1 => el.key.clone(),
|
||||||
Some(BodyNode::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
|
Some(BodyNode::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ impl<R: Eq + Hash> Comparer<R> {
|
|||||||
drop(subscribers);
|
drop(subscribers);
|
||||||
let mut subscribers = self.subscribers.write();
|
let mut subscribers = self.subscribers.write();
|
||||||
let signal = Signal::new(false);
|
let signal = Signal::new(false);
|
||||||
subscribers.insert(value, signal.clone());
|
subscribers.insert(value, signal);
|
||||||
signal.into()
|
signal.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,9 +31,7 @@ impl<R: Eq + Hash> Comparer<R> {
|
|||||||
|
|
||||||
impl<R> Clone for Comparer<R> {
|
impl<R> Clone for Comparer<R> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Self {
|
*self
|
||||||
subscribers: self.subscribers.clone(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user