File tree 5 files changed +5
-21
lines changed
5 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -691,15 +691,11 @@ impl RelativeSize {
691
691
}
692
692
}
693
693
694
- #[ derive( Clone , Debug ) ]
694
+ #[ derive( Clone , Debug , Default ) ]
695
695
pub struct HookSet {
696
696
hooks : HashMap < String , Hook >
697
697
}
698
698
699
- impl Default for HookSet {
700
- fn default ( ) -> HookSet { HookSet { hooks : Default :: default ( ) } }
701
- }
702
-
703
699
impl HookSet {
704
700
pub fn execute ( & self , which : & str , root : & Option < & String > ) -> Result < ( ) > {
705
701
if let Some ( hook) = self . hooks . get ( which) {
Original file line number Diff line number Diff line change @@ -863,15 +863,11 @@ impl fmt::Display for FromTagBuf {
863
863
}
864
864
}
865
865
866
- #[ derive( Deserialize , Debug ) ]
866
+ #[ derive( Deserialize , Debug , Default ) ]
867
867
pub struct Auth {
868
868
github_token : Option < String >
869
869
}
870
870
871
- impl Default for Auth {
872
- fn default ( ) -> Auth { Auth { github_token : None } }
873
- }
874
-
875
871
impl Auth {
876
872
pub fn github_token ( & self ) -> & Option < String > { & self . github_token }
877
873
pub fn set_github_token ( & mut self , token : Option < String > ) { self . github_token = token; }
Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ impl FileVersionSummary {
311
311
}
312
312
}
313
313
314
- fn yaml_escape_single ( val : & str ) -> String { val. replace ( "'" , "''" ) }
314
+ fn yaml_escape_single ( val : & str ) -> String { val. replace ( '\'' , "''" ) }
315
315
316
316
struct TagVersionSummary { }
317
317
Original file line number Diff line number Diff line change @@ -226,15 +226,11 @@ fn read_user_prefs() -> Result<UserPrefs> {
226
226
Ok ( user_prefs)
227
227
}
228
228
229
- #[ derive( Deserialize , Debug ) ]
229
+ #[ derive( Deserialize , Debug , Default ) ]
230
230
struct UserPrefs {
231
231
auth : Auth
232
232
}
233
233
234
- impl Default for UserPrefs {
235
- fn default ( ) -> UserPrefs { UserPrefs { auth : Default :: default ( ) } }
236
- }
237
-
238
234
impl UserPrefs {
239
235
fn auth ( & self ) -> & Auth { & self . auth }
240
236
fn auth_mut ( & mut self ) -> & mut Auth { & mut self . auth }
Original file line number Diff line number Diff line change @@ -304,15 +304,11 @@ impl CommitState {
304
304
}
305
305
}
306
306
307
- #[ derive( Deserialize , Serialize ) ]
307
+ #[ derive( Deserialize , Serialize , Default ) ]
308
308
pub struct PrevTagMessage {
309
309
versions : HashMap < ProjectId , String >
310
310
}
311
311
312
- impl Default for PrevTagMessage {
313
- fn default ( ) -> PrevTagMessage { PrevTagMessage { versions : HashMap :: new ( ) } }
314
- }
315
-
316
312
impl PrevTagMessage {
317
313
pub fn new ( versions : HashMap < ProjectId , String > ) -> PrevTagMessage { PrevTagMessage { versions } }
318
314
pub fn into_versions ( self ) -> HashMap < ProjectId , String > { self . versions }
You can’t perform that action at this time.
0 commit comments