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
|
||||
// create the new children afresh.
|
||||
if shared_keys.is_empty() {
|
||||
if old.get(0).is_some() {
|
||||
if old.first().is_some() {
|
||||
self.remove_nodes(&old[1..]);
|
||||
self.replace(&old[0], new);
|
||||
} else {
|
||||
|
||||
@@ -22,8 +22,6 @@ mod atoms {
|
||||
pub use atom::*;
|
||||
pub use atomfamily::*;
|
||||
pub use atomref::*;
|
||||
pub use selector::*;
|
||||
pub use selectorfamily::*;
|
||||
}
|
||||
|
||||
pub mod hooks {
|
||||
|
||||
@@ -193,7 +193,7 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
||||
fn to_tokens(&self, out_tokens: &mut TokenStream2) {
|
||||
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::Component(comp)) if self.roots.len() == 1 => comp.key().cloned(),
|
||||
_ => None,
|
||||
|
||||
@@ -22,7 +22,7 @@ impl<R: Eq + Hash> Comparer<R> {
|
||||
drop(subscribers);
|
||||
let mut subscribers = self.subscribers.write();
|
||||
let signal = Signal::new(false);
|
||||
subscribers.insert(value, signal.clone());
|
||||
subscribers.insert(value, signal);
|
||||
signal.into()
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,7 @@ impl<R: Eq + Hash> Comparer<R> {
|
||||
|
||||
impl<R> Clone for Comparer<R> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
subscribers: self.subscribers.clone(),
|
||||
}
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user