My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities.
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

refac: cleanup before merge

+21 -51
+6 -6
crates/tree/src/iterators.rs
··· 14 14 15 15 impl<'a, T> Children<'a, T> { 16 16 // we actually want to 17 - #[allow(clippy::use_self)] 17 + #[expect(clippy::use_self)] 18 18 pub(crate) fn new(tree: &'a Tree<T>, node_id: &NodeId) -> Children<'a, T> { 19 19 Children { 20 20 tree, ··· 60 60 } 61 61 62 62 impl<'a> ChildrenIds<'a> { 63 - #[allow(clippy::use_self)] 63 + #[expect(clippy::use_self)] 64 64 pub(crate) fn new<T>(tree: &'a Tree<T>, node_id: &NodeId) -> ChildrenIds<'a> { 65 65 ChildrenIds { 66 66 child_ids: tree ··· 95 95 } 96 96 97 97 impl<'a, T> Ancestors<'a, T> { 98 - #[allow(clippy::use_self)] 98 + #[expect(clippy::use_self)] 99 99 pub(crate) const fn new(tree: &'a Tree<T>, node_id: NodeId) -> Ancestors<'a, T> { 100 100 Ancestors { 101 101 tree, ··· 137 137 } 138 138 139 139 impl<'a, T> AncestorsIds<'a, T> { 140 - #[allow(clippy::use_self)] 140 + #[expect(clippy::use_self)] 141 141 pub(crate) const fn new(tree: &'a Tree<T>, node_id: NodeId) -> AncestorsIds<'a, T> { 142 142 AncestorsIds { 143 143 tree, ··· 179 179 } 180 180 181 181 impl<'a, T> PreOrderTraversal<'a, T> { 182 - #[allow(clippy::use_self)] 182 + #[expect(clippy::use_self)] 183 183 pub(crate) fn new(tree: &'a Tree<T>, node_id: NodeId) -> PreOrderTraversal<'a, T> { 184 184 let mut data = VecDeque::with_capacity(tree.capacity()); 185 185 data.push_front(node_id); ··· 223 223 } 224 224 225 225 impl<'a, T> PreOrderTraversalIds<'a, T> { 226 - #[allow(clippy::use_self)] 226 + #[expect(clippy::use_self)] 227 227 pub(crate) fn new(tree: &'a Tree<T>, node_id: NodeId) -> PreOrderTraversalIds<'a, T> { 228 228 // Over allocating, but all at once instead of resizing and reallocating as we go. 229 229 let mut data = VecDeque::with_capacity(tree.capacity());
+1 -1
crates/tree/src/lib.rs
··· 39 39 40 40 impl NodeId { 41 41 // This is okay since we are practically never reaching 2^32. 42 - #[allow(clippy::cast_possible_truncation)] 42 + #[expect(clippy::cast_possible_truncation)] 43 43 pub(crate) const fn new(index: usize) -> Self { 44 44 Self { 45 45 index: index as u32,
+1 -1
crates/tree/src/node.rs
··· 31 31 /// let _one: Node<i32> = Node::new(1); 32 32 /// ``` 33 33 /// 34 - #[allow(clippy::use_self)] 34 + #[expect(clippy::use_self)] 35 35 pub const fn new(data: T) -> Node<T> { 36 36 Self { 37 37 parent: None,
+11 -11
crates/tree/src/tree.rs
··· 30 30 /// let _tree_builder: TreeBuilder<i32> = TreeBuilder::new(); 31 31 /// 32 32 /// ``` 33 - #[allow(clippy::use_self)] 33 + #[expect(clippy::use_self)] 34 34 #[must_use] 35 35 pub const fn new() -> TreeBuilder<T> { 36 36 TreeBuilder { ··· 49 49 /// let _tree_builder: TreeBuilder<i32> = TreeBuilder::new().with_root(Node::new(1)); 50 50 /// ``` 51 51 #[must_use] 52 - #[allow(clippy::use_self)] 52 + #[expect(clippy::use_self)] 53 53 pub fn with_root(mut self, root: Node<T>) -> TreeBuilder<T> { 54 54 self.root = Some(root); 55 55 self ··· 71 71 /// 72 72 /// ``` 73 73 #[must_use] 74 - #[allow(clippy::use_self)] 74 + #[expect(clippy::use_self)] 75 75 pub const fn with_node_capacity(mut self, node_capacity: usize) -> TreeBuilder<T> { 76 76 self.node_capacity = node_capacity; 77 77 self ··· 82 82 /// `Tree`'s attempt to save time by reusing storage space 83 83 /// when `Node`'s are removed (instead of shuffling `Node`'s around internally). 84 84 /// To do this, the `Tree` must store information about the space left behind when a `Node` 85 - /// is removed. Using this setting allows the `Tree` to pre-allocate this storage 85 + /// is removed. Using this setting expects the `Tree` to pre-allocate this storage 86 86 /// space instead of doing so as `Node`'s are removed from the `Tree`. 87 87 /// 88 88 /// _Use of this setting is recommended if you know the **maximum "net number ··· 110 110 /// 111 111 /// ``` 112 112 #[must_use] 113 - #[allow(clippy::use_self)] 113 + #[expect(clippy::use_self)] 114 114 pub const fn with_swap_capacity(mut self, swap_capacity: usize) -> TreeBuilder<T> { 115 115 self.swap_capacity = swap_capacity; 116 116 self ··· 217 217 /// let _tree: Tree<i32> = Tree::new(); 218 218 /// ``` 219 219 #[must_use] 220 - #[allow(clippy::use_self)] 220 + #[expect(clippy::use_self)] 221 221 pub fn new() -> Tree<T> { 222 222 TreeBuilder::new().build() 223 223 } ··· 380 380 /// 381 381 /// tree.insert(child_node, UnderNode(&root_id)).unwrap(); 382 382 /// ``` 383 - #[allow(clippy::needless_pass_by_value)] 383 + #[expect(clippy::needless_pass_by_value)] 384 384 pub fn insert( 385 385 &mut self, 386 386 node: Node<T>, ··· 425 425 /// # assert_eq!(child.children().len(), 0); 426 426 /// # assert_eq!(child.parent(), None); 427 427 /// ``` 428 - #[allow(clippy::needless_pass_by_value)] 428 + #[expect(clippy::needless_pass_by_value)] 429 429 pub fn remove_node( 430 430 &mut self, 431 431 node_id: NodeId, ··· 494 494 /// Can panic if the `NodeId` does not exist in the `Tree`, but this would 495 495 /// be a bug in `tree` 496 496 /// 497 - #[allow(clippy::needless_pass_by_value)] 497 + #[expect(clippy::needless_pass_by_value)] 498 498 pub fn move_node( 499 499 &mut self, 500 500 node_id: &NodeId, ··· 985 985 } 986 986 987 987 // We want to have the node_id be consumed by this remove function. 988 - #[allow(clippy::needless_pass_by_value)] 988 + #[expect(clippy::needless_pass_by_value)] 989 989 fn remove_node_internal(&mut self, node_id: NodeId) -> Node<T> { 990 990 if let Some(root_id) = &self.root 991 991 && node_id == *root_id ··· 1213 1213 } 1214 1214 1215 1215 #[cfg(test)] 1216 - #[allow(clippy::similar_names)] 1216 + #[expect(clippy::similar_names)] 1217 1217 mod tree_tests { 1218 1218 use crate::InsertBehavior; 1219 1219 use crate::MoveBehavior;
-1
src/tui/app.rs
··· 25 25 components: Vec<Box<dyn Component>>, 26 26 should_quit: bool, 27 27 should_suspend: bool, 28 - #[allow(dead_code)] 29 28 page: Page, 30 29 last_tick_key_events: Vec<KeyEvent>, 31 30 kh: KastenHandle,
+1 -2
src/tui/components/todo/explorer.rs
··· 11 11 #[derive(Debug)] 12 12 pub struct Explorer<'text> { 13 13 pub render_list: ratatui::widgets::List<'text>, 14 - #[allow(dead_code)] 15 14 pub id_list: Vec<NodeId>, 16 15 pub state: ListState, 17 - #[allow(dead_code)] 16 + #[expect(dead_code)] 18 17 pub width: u16, 19 18 } 20 19
-2
src/tui/components/todo/inspector/mod.rs
··· 149 149 Ok(()) 150 150 } 151 151 152 - #[allow(clippy::too_many_lines)] 153 152 async fn update(&mut self, signal: Signal) -> color_eyre::Result<Option<Signal>> { 154 153 match signal { 155 154 Signal::EditName => { ··· 205 204 Ok(None) 206 205 } 207 206 208 - #[allow(clippy::too_many_lines)] 209 207 async fn handle_key_event(&mut self, key: KeyEvent) -> color_eyre::Result<Option<Signal>> { 210 208 let signal_tx = self 211 209 .signal_tx
+1 -1
src/tui/components/todo/mod.rs
··· 261 261 Ok(()) 262 262 } 263 263 264 - #[allow(clippy::too_many_lines)] 264 + #[expect(clippy::too_many_lines)] 265 265 async fn update(&mut self, signal: Signal) -> color_eyre::Result<Option<Signal>> { 266 266 let explorer = self 267 267 .explorer
-1
src/tui/components/zk/mod.rs
··· 164 164 self.zettel_list = Some(zettel_list); 165 165 166 166 Ok(()) 167 - // what the fuck am i supposed to do here mannnn. 168 167 } 169 168 170 169 async fn update_views_from_zettel_list_selection(&mut self) -> Result<()> {
-22
src/tui/signal.rs
··· 91 91 nanoid: NanoId, 92 92 }, 93 93 } 94 - 95 - // impl FromStr for Signal { 96 - // type Err = color_eyre::Report; 97 - 98 - // fn from_str(s: &str) -> Result<Self, Self::Err> { 99 - // Ok(match s.to_lowercase().as_str() { 100 - // "suspend" => Self::Suspend, 101 - // "resume" => Self::Resume, 102 - // "quit" => Self::Quit, 103 - // "movedown" => Self::MoveDown, 104 - // "moveup" => Self::MoveUp, 105 - // "openzettel" => Self::OpenZettel, 106 - // "newzettel" => Self::NewZettel, 107 - // "newgroup" 108 - // _ => { 109 - // return Err(eyre!(format!( 110 - // "Attempt to construct a non-user Signal from str: {s}" 111 - // ))); 112 - // } 113 - // }) 114 - // } 115 - // }
-2
src/types/task.rs
··· 26 26 } 27 27 28 28 impl Task { 29 - #[allow(clippy::unused_async)] 30 - #[allow(clippy::needless_pass_by_ref_mut)] 31 29 pub async fn new( 32 30 name: impl Into<String>, 33 31 parent_id: NanoId,
-1
src/viz/mod.rs
··· 91 91 if let Ok(signal) = self.signal_rx.try_recv() { 92 92 debug!("received signal in filaments: {signal}"); 93 93 94 - #[allow(clippy::single_match)] 95 94 match signal { 96 95 Signal::CreatedZettel { zid } => { 97 96 block_on(async {