Skip to content

Commit

Permalink
We can just derive PartialEq, no need for our own implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
sondr3 committed Oct 15, 2018
1 parent feb2db4 commit 6fabb67
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ extern crate git2;
extern crate structopt;

use git2::{Commit, Repository};
use std::cmp;
use std::collections::HashMap;
use std::env;
use std::error::Error;
Expand Down Expand Up @@ -67,7 +66,7 @@ impl Repo {
}
}

#[derive(Debug, Eq)]
#[derive(Debug, Eq, PartialEq)]
struct Author {
name: String,
total_commits: usize,
Expand All @@ -85,12 +84,6 @@ impl fmt::Display for Author {
}
}

impl cmp::PartialEq for Author {
fn eq(&self, other: &Author) -> bool {
self.name == other.name
}
}

impl Author {
fn new(name: &str) -> Self {
let name = name.to_string();
Expand Down

0 comments on commit 6fabb67

Please sign in to comment.