Skip to content

Commit

Permalink
refactor: drop unneeded derives and sort
Browse files Browse the repository at this point in the history
It's already sorted by commit by `git`, so we don't need to do anything
in that branch.

Similarly, we don't need all of the deleted `derive`s here. They don't
do anything.
  • Loading branch information
lukehsiao committed Apr 26, 2024
1 parent 64a09db commit 1406e24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Cli {
reverse: bool,
}

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
#[derive(Clone, ValueEnum)]
enum SortBy {
/// Sort by author alphabetic order
Author,
Expand Down Expand Up @@ -173,7 +173,7 @@ fn main() -> Result<()> {

match cli.sort {
SortBy::Author => stats.sort_unstable_by(|a, b| b.author.cmp(&a.author)),
SortBy::Commits => stats.sort_unstable_by(|a, b| b.commits.cmp(&a.commits)),
SortBy::Commits => (), // It's already sorted by commits
SortBy::Files => stats.sort_unstable_by(|a, b| b.num_files.cmp(&a.num_files)),
SortBy::Insertions => stats.sort_unstable_by(|a, b| b.insertions.cmp(&a.insertions)),
SortBy::Deletions => stats.sort_unstable_by(|a, b| b.deletions.cmp(&a.deletions)),
Expand Down

0 comments on commit 1406e24

Please sign in to comment.