Skip to content

Commit

Permalink
Apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
imaqtkatt committed Mar 12, 2024
1 parent 203eb13 commit c2dca52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hvmc_net/mutual_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ pub fn check_cycles(book: &Book) -> Result<(), String> {
let graph = Graph::from(book);
let cycles = graph.cycles();

if cycles.is_empty() { Ok(()) } else { Err(pprint_cycles(&cycles)) }
if cycles.is_empty() { Ok(()) } else { Err(pretty_print_cycles(&cycles)) }
}

fn pprint_cycles(cycles: &[Vec<Ref>]) -> String {
fn pretty_print_cycles(cycles: &[Vec<Ref>]) -> String {
cycles
.iter()
.enumerate()
Expand Down Expand Up @@ -114,8 +114,8 @@ impl Graph {
}

pub fn add(&mut self, r#ref: Ref, dependency: Ref) {
self.0.entry(r#ref).or_insert_with(RefSet::new).insert(dependency.clone());
self.0.entry(dependency).or_insert_with(RefSet::new);
self.0.entry(r#ref).or_default().insert(dependency.clone());
self.0.entry(dependency).or_default();
}

pub fn get(&self, r#ref: &Ref) -> Option<&RefSet> {
Expand Down

0 comments on commit c2dca52

Please sign in to comment.