-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I ran cargo clippy and fixes most but not all of the warnings. I manualy reviewed all the changes ... they all look like improvements. Nothing earth shaking lots of tiny blemishes removed. By was of testing, I can asset that ``` cargo test feature --all ``` passes. When I say most but not all clippy warning are cleared. A warning of this form remains ```warning: docs for unsafe trait missing `# Safety` section``` but I think documentation issues are best dealt with in a separate issue Highlights :- 1) .any() is prefered over .find(), as it will break a "loop" on the first occurance. ``` - if let Some(_) = w_out_edges.find(|e| e.target() == nodeix(v)) { + if w_out_edges.any(|e| e.target() == nodeix(v)) { ``` 2) Was manually implementing a call to .find() ``` - while let Some(edge) = self.edges.next() { - if edge.node[1] == self.target_node { - return Some(edge); - } - } - - None + let target_node = self.target_node; + self.edges.by_ref().find(|&edge| edge.node[1] == target_node) ``` 3) Made find_join() make more flexible by accepting slices rather than a strict vec. ``` - label: &mut Vec<Label<G>>, - first_inner: &mut Vec<usize>, + label: &mut [Label<G>], + first_inner: &mut [usize], ``` 4) Now using flap_map where possible ``` - .map(|(i, &node)| { + .flat_map(|(i, &node)| { ``` 5) using .by_ref() to repalce a while loop with something more idomatic. ``` - while let Some(next) = self.iter.next() { + for next in self.iter.by_ref() { ``` 6) removed the use of a deprecated function. ``` - let weight = self.edges.remove(&Self::edge_key(a, b)); + let weight = self.edges.swap_remove(&Self::edge_key(a, b)); ```
- Loading branch information
1 parent
3361e04
commit 5cabfe3
Showing
17 changed files
with
32 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters