Skip to content

Commit

Permalink
clippyage
Browse files Browse the repository at this point in the history
  • Loading branch information
wfraser committed Jun 24, 2020
1 parent 41b40f5 commit 0b91ed7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Browser {
if let Some(method) = self.analysis.get_def(&crate_id, *id) {
// Add to the map only if not existing (if it already exists it means
// the method has been overridden).
methods.entry(def_label(method)).or_insert(Item::Def(method.clone()));
methods.entry(def_label(method)).or_insert_with(|| Item::Def(method.clone()));
}
}
}
Expand Down Expand Up @@ -169,6 +169,7 @@ fn def_label(def: &Def) -> String {
format!("{} {}", prefix, def.name)
}

#[allow(clippy::large_enum_variant)]
#[derive(Debug, Clone)]
pub enum Item {
Root,
Expand Down
2 changes: 2 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ struct UserData {
browser: Browser,
}

/// Makes a selectview showing the children of the given parent item in the given crate.
/// Returns None if there are no children to display.
fn make_selectview(data: &mut UserData, crate_id: CrateId, parent: &Item, depth: usize)
-> Option<views::SelectView<Item>>
{
Expand Down

0 comments on commit 0b91ed7

Please sign in to comment.