From d28c557b3d153fe642722c8e9f0a7c7c45fda27d Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Mon, 9 Oct 2023 00:02:13 +0200 Subject: [PATCH] Fix clippy warnings --- src/graph/builder.rs | 1 + src/graph/edge.rs | 21 --------------------- src/graph/node.rs | 8 -------- src/item.rs | 7 ------- 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/graph/builder.rs b/src/graph/builder.rs index f5f64c6..48f3368 100644 --- a/src/graph/builder.rs +++ b/src/graph/builder.rs @@ -24,6 +24,7 @@ pub struct Options {} #[derive(Debug)] pub struct Builder<'a> { + #[allow(dead_code)] options: Options, db: &'a RootDatabase, vfs: &'a Vfs, diff --git a/src/graph/edge.rs b/src/graph/edge.rs index fd0d8d3..30d5a0b 100644 --- a/src/graph/edge.rs +++ b/src/graph/edge.rs @@ -33,24 +33,3 @@ impl fmt::Display for EdgeKind { pub struct Edge { pub kind: EdgeKind, } - -impl Edge { - pub fn merge_with(&mut self, other: &Edge) { - match (self.kind, other.kind) { - (EdgeKind::Uses, EdgeKind::Uses) => { - self.kind = EdgeKind::Uses; - } - (EdgeKind::Uses, EdgeKind::Owns) - | (EdgeKind::Owns, EdgeKind::Uses) - | (EdgeKind::Owns, EdgeKind::Owns) => { - self.kind = EdgeKind::Owns; - } - } - } - - pub fn merged_with(&self, other: &Edge) -> Self { - let mut clone = self.clone(); - clone.merge_with(other); - clone - } -} diff --git a/src/graph/node.rs b/src/graph/node.rs index 4b3b2c6..0886445 100644 --- a/src/graph/node.rs +++ b/src/graph/node.rs @@ -16,18 +16,10 @@ impl Node { Self { item } } - pub fn display_name(&self) -> String { - self.item.display_name() - } - pub fn display_path(&self) -> String { self.item.display_path() } - pub fn crate_display_name(&self) -> String { - self.item.crate_display_name() - } - pub fn kind_display_name(&self, db: &RootDatabase) -> Option { self.item.kind_display_name(db) } diff --git a/src/item.rs b/src/item.rs index b1aba25..245915b 100644 --- a/src/item.rs +++ b/src/item.rs @@ -85,13 +85,6 @@ impl Item { self.path.join("::") } - pub fn crate_display_name(&self) -> String { - self.path - .first() - .expect("Expected path with at least one component") - .clone() - } - pub fn kind_display_name(&self, db: &RootDatabase) -> Option { let Some(module_def) = self.hir else { return None;