fmt: apply formatting just to tests

This commit is contained in:
Jonathan Kelley committed 2022-01-31 02:44:16 -05:00
1 parent 5bffbba682
commit 00aa0e5e86
7 files changed
+119 -38

No files matched your search

+22 -7
View File
@@ -315,9 +315,11 @@ impl ScopeArena {
frame.node.set(unsafe { extend_vnode(node) });
} else {
let frame = scope.wip_frame();
let node = frame.bump.alloc(VNode::Placeholder(
frame.bump.alloc(VPlaceholder { id: Default::default() }),
));
let node = frame
.bump
.alloc(VNode::Placeholder(frame.bump.alloc(VPlaceholder {
id: Default::default(),
})));
frame.node.set(unsafe { extend_vnode(node) });
}
@@ -427,7 +429,10 @@ pub struct Scope<'a, P = ()> {
impl<P> Copy for Scope<'_, P> {}
impl<P> Clone for Scope<'_, P> {
fn clone(&self) -> Self {
Self { scope: self.scope, props: self.props }
Self {
scope: self.scope,
props: self.props,
}
}
}
@@ -789,7 +794,10 @@ impl ScopeState {
/// }
///```
pub fn render<'src>(&'src self, rsx: LazyNodes<'src, '_>) -> Option<VNode<'src>> {
Some(rsx.call(NodeFactory { scope: self, bump: &self.wip_frame().bump }))
Some(rsx.call(NodeFactory {
scope: self,
bump: &self.wip_frame().bump,
}))
}
/// Store a value between renders
@@ -896,7 +904,10 @@ impl ScopeState {
self.shared_contexts.get_mut().clear();
// next: reset the node data
let SelfReferentialItems { borrowed_props, listeners } = self.items.get_mut();
let SelfReferentialItems {
borrowed_props,
listeners,
} = self.items.get_mut();
borrowed_props.clear();
listeners.clear();
self.frames[0].reset();
@@ -954,7 +965,11 @@ pub(crate) struct TaskQueue {
pub(crate) type InnerTask = Pin<Box<dyn Future<Output = ()>>>;
impl TaskQueue {
fn new(sender: UnboundedSender<SchedulerMsg>) -> Rc<Self> {
Rc::new(Self { tasks: RefCell::new(FxHashMap::default()), gen: Cell::new(0), sender })
Rc::new(Self {
tasks: RefCell::new(FxHashMap::default()),
gen: Cell::new(0),
sender,
})
}
fn push_fut(&self, task: impl Future<Output = ()> + 'static) -> TaskId {
let pinned = Box::pin(task);