wip: cargo fix

This commit is contained in:
Jonathan Kelley committed 2021-07-13 16:48:47 -04:00
1 parent 775e9e29b8
commit c7ca7c2273
9 files changed
+67 -68

No files matched your search

+4 -4
View File
@@ -59,8 +59,8 @@ impl SharedArena {
pub fn with_scope<'b, O: 'static>(
&'b self,
id: ScopeIdx,
f: impl FnOnce(&'b mut Scope) -> O,
_id: ScopeIdx,
_f: impl FnOnce(&'b mut Scope) -> O,
) -> Result<O> {
todo!()
}
@@ -69,8 +69,8 @@ impl SharedArena {
// this is useful for merging lifetimes
pub fn with_scope_vnode<'b>(
&self,
id: ScopeIdx,
f: impl FnOnce(&mut Scope) -> &VNode<'b>,
_id: ScopeIdx,
_f: impl FnOnce(&mut Scope) -> &VNode<'b>,
) -> Result<&VNode<'b>> {
todo!()
}
+12 -12
View File
@@ -1,13 +1,13 @@
use crate::hooklist::HookList;
use crate::{arena::SharedArena, innerlude::*};
use appendlist::AppendList;
use bumpalo::Bump;
use futures_util::{pin_mut, FutureExt};
use slotmap::DefaultKey;
use slotmap::SlotMap;
use crate::{innerlude::*};
use futures_util::{FutureExt};
use std::borrow::BorrowMut;
use std::marker::PhantomData;
use std::sync::{Arc, RwLock};
use std::{
any::{Any, TypeId},
cell::{Cell, RefCell},
@@ -137,7 +137,7 @@ impl<'src, P> Context<'src, P> {
self,
initializer: Init,
runner: Run,
cleanup: Cleanup,
_cleanup: Cleanup,
) -> Output
where
State: 'static,
@@ -280,7 +280,7 @@ Any function prefixed with "use" should not be called conditionally.
///
///
///
pub fn submit_task(&self, task: Pin<Box<dyn Future<Output = ()>>>) -> TaskHandle {
pub fn submit_task(&self, _task: Pin<Box<dyn Future<Output = ()>>>) -> TaskHandle {
// let r = task.then(|f| async {
// //
// });
@@ -356,8 +356,8 @@ Any function prefixed with "use" should not be called conditionally.
///
pub fn suspend<Out, Fut: 'static>(
&'src self,
task_initializer: impl FnOnce() -> Fut + 'src,
callback: impl FnOnce(SuspendedContext, Out) -> VNode<'src> + 'src,
_task_initializer: impl FnOnce() -> Fut + 'src,
_callback: impl FnOnce(SuspendedContext, Out) -> VNode<'src> + 'src,
) -> VNode<'src>
where
Out: 'src,
+17 -17
View File
@@ -49,7 +49,7 @@
//! - https://hacks.mozilla.org/2019/03/fast-bump-allocated-virtual-doms-with-rust-and-wasm/
use crate::{arena::SharedArena, innerlude::*, tasks::TaskQueue};
use fxhash::{FxHashMap, FxHashSet};
use fxhash::{FxHashSet};
use std::any::Any;
@@ -360,9 +360,9 @@ where
attributes,
children,
namespace,
static_attrs,
static_children,
static_listeners,
static_attrs: _,
static_children: _,
static_listeners: _,
} = el;
let real_id = if let Some(namespace) = namespace {
@@ -559,7 +559,7 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
// if any characteristics changed, remove and then re-add
// if nothing changed, then just move on
let event_type = new_l.event;
let _event_type = new_l.event;
for old_l in old {
if new_l.event == old_l.event {
@@ -821,8 +821,8 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
// Upon exit, the change list stack is the same.
fn diff_keyed_prefix(
&self,
old: &'bump [VNode<'bump>],
new: &'bump [VNode<'bump>],
_old: &'bump [VNode<'bump>],
_new: &'bump [VNode<'bump>],
) -> KeyedPrefixResult {
todo!()
// self.dom.go_down();
@@ -910,11 +910,11 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
// Upon exit from this function, it will be restored to that same state.
fn diff_keyed_middle(
&self,
old: &[VNode<'bump>],
mut new: &[VNode<'bump>],
shared_prefix_count: usize,
shared_suffix_count: usize,
old_shared_suffix_start: usize,
_old: &[VNode<'bump>],
_new: &[VNode<'bump>],
_shared_prefix_count: usize,
_shared_suffix_count: usize,
_old_shared_suffix_start: usize,
) {
todo!()
// // Should have already diffed the shared-key prefixes and suffixes.
@@ -1138,9 +1138,9 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
// When this function exits, the change list stack remains the same.
fn diff_keyed_suffix(
&self,
old: &[VNode<'bump>],
new: &[VNode<'bump>],
new_shared_suffix_start: usize,
_old: &[VNode<'bump>],
_new: &[VNode<'bump>],
_new_shared_suffix_start: usize,
) {
todo!()
// debug_assert_eq!(old.len(), new.len());
@@ -1178,7 +1178,7 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
// [... parent child]
// todo!()
for (i, (new_child, old_child)) in new.iter().zip(old.iter()).enumerate() {
for (_i, (new_child, old_child)) in new.iter().zip(old.iter()).enumerate() {
// [... parent prev_child]
// self.dom.go_to_sibling(i);
// [... parent this_child]
@@ -1247,7 +1247,7 @@ impl<'a, 'bump, Dom: RealDom<'bump>> DiffMachine<'a, 'bump, Dom> {
pub fn remove_self_and_next_siblings(&self, old: &[VNode<'bump>]) {
// debug_assert!(self.dom.traversal_is_committed());
for child in old {
if let VNodeKind::Component(vcomp) = child.kind {
if let VNodeKind::Component(_vcomp) = child.kind {
// dom
// .create_text_node("placeholder for vcomponent");
+1 -1
View File
@@ -4,7 +4,7 @@
//! 3rd party renderers are responsible for converting their native events into these virtual event types. Events might
//! be heavy or need to interact through FFI, so the events themselves are designed to be lazy.
use std::{cell::Cell, ops::Deref, rc::Rc};
use crate::innerlude::{RealDomNode, ScopeIdx};
+6 -6
View File
@@ -173,10 +173,10 @@ impl<'a> NodeFactory<'a> {
pub fn raw_element(
&self,
tag: &'static str,
listeners: &[Listener],
attributes: &[Attribute],
children: &'a [VNode<'a>],
_tag: &'static str,
_listeners: &[Listener],
_attributes: &[Attribute],
_children: &'a [VNode<'a>],
) -> VNode<'a> {
todo!()
}
@@ -295,7 +295,7 @@ impl<'a> NodeFactory<'a> {
let res = component(cx);
// submit any async tasks to the scope
for task in tasks.borrow_mut().drain(..) {
for _task in tasks.borrow_mut().drain(..) {
// scp.submit_task(task);
}
@@ -453,7 +453,7 @@ impl Debug for VNode<'_> {
}
mod tests {
use super::*;
static B1: &str = "hello world!";
static B2: &str = "hello world!";
+7 -7
View File
@@ -1,11 +1,11 @@
use crate::hooklist::HookList;
use crate::{arena::SharedArena, innerlude::*};
use appendlist::AppendList;
use bumpalo::Bump;
use slotmap::DefaultKey;
use slotmap::SlotMap;
use std::marker::PhantomData;
use std::sync::Arc;
use std::{
any::{Any, TypeId},
cell::{Cell, RefCell},
@@ -182,7 +182,7 @@ impl Scope {
self.arena_idx
);
let mut listners = self.listeners.borrow_mut();
let listners = self.listeners.borrow_mut();
// let listener = listners.get(trigger);
let raw_listener = listners.iter().find(|(domptr, _)| {
+4 -4
View File
@@ -16,7 +16,7 @@ use std::{
task::{Context, Poll},
};
use futures_util::{Future, Stream, StreamExt};
use futures_util::{Future, Stream};
use slotmap::{DefaultKey, SlotMap};
use crate::{events::EventTrigger, innerlude::ScopeIdx};
@@ -64,19 +64,19 @@ impl Stream for TaskQueue {
/// We can never be finished polling
fn poll_next(
mut self: Pin<&mut Self>,
self: Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
// let yield_every = self.len();
// let mut polled = 0;
let mut slots = self.slots.write().unwrap();
for (key, slot) in slots.iter_mut() {
for (_key, slot) in slots.iter_mut() {
if slot.dead.get() {
continue;
}
let r = slot.fut;
let mut fut = unsafe { &mut *r };
let fut = unsafe { &mut *r };
// use futures::{future::Future, poll, FutureExt};
let f2 = fut.as_mut();
+13 -14
View File
@@ -1,7 +1,6 @@
use std::{
cell::{Cell, RefCell, RefMut},
rc::Rc,
vec::Drain,
};
use futures_util::StreamExt;
@@ -89,23 +88,23 @@ impl DebugDom {
}
}
impl<'a> RealDom<'a> for DebugDom {
fn push(&mut self, root: RealDomNode) {}
fn push(&mut self, _root: RealDomNode) {}
fn pop(&mut self) {}
fn append_children(&mut self, many: u32) {}
fn append_children(&mut self, _many: u32) {}
fn replace_with(&mut self, many: u32) {}
fn replace_with(&mut self, _many: u32) {}
fn remove(&mut self) {}
fn remove_all_children(&mut self) {}
fn create_text_node(&mut self, text: &str) -> RealDomNode {
fn create_text_node(&mut self, _text: &str) -> RealDomNode {
self.counter += 1;
RealDomNode::new(self.counter)
}
fn create_element(&mut self, tag: &str, ns: Option<&'a str>) -> RealDomNode {
fn create_element(&mut self, _tag: &str, _ns: Option<&'a str>) -> RealDomNode {
self.counter += 1;
RealDomNode::new(self.counter)
}
@@ -117,20 +116,20 @@ impl<'a> RealDom<'a> for DebugDom {
fn new_event_listener(
&mut self,
event: &str,
scope: ScopeIdx,
element_id: usize,
realnode: RealDomNode,
_event: &str,
_scope: ScopeIdx,
_element_id: usize,
_realnode: RealDomNode,
) {
}
fn remove_event_listener(&mut self, event: &str) {}
fn remove_event_listener(&mut self, _event: &str) {}
fn set_text(&mut self, text: &str) {}
fn set_text(&mut self, _text: &str) {}
fn set_attribute(&mut self, name: &str, value: &str, namespace: Option<&str>) {}
fn set_attribute(&mut self, _name: &str, _value: &str, _namespace: Option<&str>) {}
fn remove_attribute(&mut self, name: &str) {}
fn remove_attribute(&mut self, _name: &str) {}
fn raw_node_as_any_mut(&self) -> &mut dyn std::any::Any {
todo!()
+3 -3
View File
@@ -21,13 +21,13 @@
use crate::tasks::TaskQueue;
use crate::{arena::SharedArena, innerlude::*};
use appendlist::AppendList;
use slotmap::DefaultKey;
use slotmap::SlotMap;
use std::any::Any;
use std::cell::RefCell;
use std::pin::Pin;
use std::{any::TypeId, fmt::Debug, rc::Rc};
use std::{any::TypeId};
pub type ScopeIdx = DefaultKey;