Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
regexident committed Oct 8, 2023
1 parent 8dc52c0 commit d28c557
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
1 change: 1 addition & 0 deletions src/graph/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct Options {}

#[derive(Debug)]
pub struct Builder<'a> {
#[allow(dead_code)]
options: Options,
db: &'a RootDatabase,
vfs: &'a Vfs,
Expand Down
21 changes: 0 additions & 21 deletions src/graph/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
8 changes: 0 additions & 8 deletions src/graph/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
self.item.kind_display_name(db)
}
Expand Down
7 changes: 0 additions & 7 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
let Some(module_def) = self.hir else {
return None;
Expand Down

0 comments on commit d28c557

Please sign in to comment.