intial update to new mutations
This commit is contained in:
1 parent
078b8ba833
commit
dcad2fe8a2
6 files changed
+440
-755
No files matched your search
@@ -1,17 +1,18 @@
|
||||
use std::{cmp::Ordering, fmt::Debug};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use crate::node::NodeData;
|
||||
use crate::node_ref::{NodeMask, NodeView};
|
||||
use crate::tree::TreeView;
|
||||
use crate::RealNodeId;
|
||||
use anymap::AnyMap;
|
||||
use rustc_hash::FxHashSet;
|
||||
|
||||
/// Join two sorted iterators
|
||||
pub(crate) fn union_ordered_iter<T: Ord + Debug>(
|
||||
s_iter: impl Iterator<Item = T>,
|
||||
o_iter: impl Iterator<Item = T>,
|
||||
pub(crate) fn union_ordered_iter<'a>(
|
||||
s_iter: impl Iterator<Item = &'a str>,
|
||||
o_iter: impl Iterator<Item = &'a str>,
|
||||
new_len_guess: usize,
|
||||
) -> Vec<T> {
|
||||
) -> Vec<String> {
|
||||
let mut s_peekable = s_iter.peekable();
|
||||
let mut o_peekable = o_iter.peekable();
|
||||
let mut v = Vec::with_capacity(new_len_guess);
|
||||
@@ -22,7 +23,7 @@ pub(crate) fn union_ordered_iter<T: Ord + Debug>(
|
||||
break;
|
||||
}
|
||||
Ordering::Less => {
|
||||
v.push(o_peekable.next().unwrap());
|
||||
v.push(o_peekable.next().unwrap().to_string());
|
||||
}
|
||||
Ordering::Equal => {
|
||||
o_peekable.next();
|
||||
@@ -30,10 +31,10 @@ pub(crate) fn union_ordered_iter<T: Ord + Debug>(
|
||||
}
|
||||
}
|
||||
}
|
||||
v.push(s_peekable.next().unwrap());
|
||||
v.push(s_peekable.next().unwrap().to_string());
|
||||
}
|
||||
for o_i in o_peekable {
|
||||
v.push(o_i);
|
||||
v.push(o_i.to_string());
|
||||
}
|
||||
for w in v.windows(2) {
|
||||
debug_assert!(w[1] > w[0]);
|
||||
@@ -207,11 +208,7 @@ pub trait NodeDepState<DepState = ()> {
|
||||
/// Do not implement this trait. It is only meant to be derived and used through [crate::real_dom::RealDom].
|
||||
pub trait State: Default + Clone {
|
||||
#[doc(hidden)]
|
||||
fn update<
|
||||
'a,
|
||||
T: Traversable<Node = Self, Id = RealNodeId>,
|
||||
T2: Traversable<Node = NodeData, Id = RealNodeId>,
|
||||
>(
|
||||
fn update<'a, T: TreeView<Self>, T2: TreeView<NodeData>>(
|
||||
dirty: &[(RealNodeId, NodeMask)],
|
||||
state_tree: &'a mut T,
|
||||
rdom: &'a T2,
|
||||
|
||||
Reference in new issue
Block a user