Skip to content

Commit 6e1f802

Browse files
committed
fix: clippy
1 parent e328984 commit 6e1f802

File tree

5 files changed

+5
-21
lines changed

5 files changed

+5
-21
lines changed

src/config.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -691,15 +691,11 @@ impl RelativeSize {
691691
}
692692
}
693693

694-
#[derive(Clone, Debug)]
694+
#[derive(Clone, Debug, Default)]
695695
pub struct HookSet {
696696
hooks: HashMap<String, Hook>
697697
}
698698

699-
impl Default for HookSet {
700-
fn default() -> HookSet { HookSet { hooks: Default::default() } }
701-
}
702-
703699
impl HookSet {
704700
pub fn execute(&self, which: &str, root: &Option<&String>) -> Result<()> {
705701
if let Some(hook) = self.hooks.get(which) {

src/git.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -863,15 +863,11 @@ impl fmt::Display for FromTagBuf {
863863
}
864864
}
865865

866-
#[derive(Deserialize, Debug)]
866+
#[derive(Deserialize, Debug, Default)]
867867
pub struct Auth {
868868
github_token: Option<String>
869869
}
870870

871-
impl Default for Auth {
872-
fn default() -> Auth { Auth { github_token: None } }
873-
}
874-
875871
impl Auth {
876872
pub fn github_token(&self) -> &Option<String> { &self.github_token }
877873
pub fn set_github_token(&mut self, token: Option<String>) { self.github_token = token; }

src/init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl FileVersionSummary {
311311
}
312312
}
313313

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

316316
struct TagVersionSummary {}
317317

src/mono.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,11 @@ fn read_user_prefs() -> Result<UserPrefs> {
226226
Ok(user_prefs)
227227
}
228228

229-
#[derive(Deserialize, Debug)]
229+
#[derive(Deserialize, Debug, Default)]
230230
struct UserPrefs {
231231
auth: Auth
232232
}
233233

234-
impl Default for UserPrefs {
235-
fn default() -> UserPrefs { UserPrefs { auth: Default::default() } }
236-
}
237-
238234
impl UserPrefs {
239235
fn auth(&self) -> &Auth { &self.auth }
240236
fn auth_mut(&mut self) -> &mut Auth { &mut self.auth }

src/state.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,11 @@ impl CommitState {
304304
}
305305
}
306306

307-
#[derive(Deserialize, Serialize)]
307+
#[derive(Deserialize, Serialize, Default)]
308308
pub struct PrevTagMessage {
309309
versions: HashMap<ProjectId, String>
310310
}
311311

312-
impl Default for PrevTagMessage {
313-
fn default() -> PrevTagMessage { PrevTagMessage { versions: HashMap::new() } }
314-
}
315-
316312
impl PrevTagMessage {
317313
pub fn new(versions: HashMap<ProjectId, String>) -> PrevTagMessage { PrevTagMessage { versions } }
318314
pub fn into_versions(self) -> HashMap<ProjectId, String> { self.versions }

0 commit comments

Comments
 (0)