Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
chaaz committed Jun 23, 2022
1 parent e328984 commit 6e1f802
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
6 changes: 1 addition & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,15 +691,11 @@ impl RelativeSize {
}
}

#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct HookSet {
hooks: HashMap<String, Hook>
}

impl Default for HookSet {
fn default() -> HookSet { HookSet { hooks: Default::default() } }
}

impl HookSet {
pub fn execute(&self, which: &str, root: &Option<&String>) -> Result<()> {
if let Some(hook) = self.hooks.get(which) {
Expand Down
6 changes: 1 addition & 5 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,15 +863,11 @@ impl fmt::Display for FromTagBuf {
}
}

#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Auth {
github_token: Option<String>
}

impl Default for Auth {
fn default() -> Auth { Auth { github_token: None } }
}

impl Auth {
pub fn github_token(&self) -> &Option<String> { &self.github_token }
pub fn set_github_token(&mut self, token: Option<String>) { self.github_token = token; }
Expand Down
2 changes: 1 addition & 1 deletion src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl FileVersionSummary {
}
}

fn yaml_escape_single(val: &str) -> String { val.replace("'", "''") }
fn yaml_escape_single(val: &str) -> String { val.replace('\'', "''") }

struct TagVersionSummary {}

Expand Down
6 changes: 1 addition & 5 deletions src/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,11 @@ fn read_user_prefs() -> Result<UserPrefs> {
Ok(user_prefs)
}

#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
struct UserPrefs {
auth: Auth
}

impl Default for UserPrefs {
fn default() -> UserPrefs { UserPrefs { auth: Default::default() } }
}

impl UserPrefs {
fn auth(&self) -> &Auth { &self.auth }
fn auth_mut(&mut self) -> &mut Auth { &mut self.auth }
Expand Down
6 changes: 1 addition & 5 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,11 @@ impl CommitState {
}
}

#[derive(Deserialize, Serialize)]
#[derive(Deserialize, Serialize, Default)]
pub struct PrevTagMessage {
versions: HashMap<ProjectId, String>
}

impl Default for PrevTagMessage {
fn default() -> PrevTagMessage { PrevTagMessage { versions: HashMap::new() } }
}

impl PrevTagMessage {
pub fn new(versions: HashMap<ProjectId, String>) -> PrevTagMessage { PrevTagMessage { versions } }
pub fn into_versions(self) -> HashMap<ProjectId, String> { self.versions }
Expand Down

0 comments on commit 6e1f802

Please sign in to comment.