File tree 9 files changed +23
-35
lines changed
9 files changed +23
-35
lines changed Original file line number Diff line number Diff line change @@ -286,10 +286,8 @@ impl BlameFileComponent {
286
286
& mut self ,
287
287
event : AsyncGitNotification ,
288
288
) -> Result < ( ) > {
289
- if self . is_visible ( ) {
290
- if let AsyncGitNotification :: Blame = event {
291
- self . update ( ) ?;
292
- }
289
+ if self . is_visible ( ) && event == AsyncGitNotification :: Blame {
290
+ self . update ( ) ?;
293
291
}
294
292
295
293
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -350,10 +350,8 @@ impl BranchListComponent {
350
350
& mut self ,
351
351
ev : AsyncGitNotification ,
352
352
) -> Result < ( ) > {
353
- if self . is_visible ( ) {
354
- if let AsyncGitNotification :: Push = ev {
355
- self . update_branches ( ) ?;
356
- }
353
+ if self . is_visible ( ) && ev == AsyncGitNotification :: Push {
354
+ self . update_branches ( ) ?;
357
355
}
358
356
359
357
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -209,9 +209,9 @@ impl CompareCommitsComponent {
209
209
ev : AsyncGitNotification ,
210
210
) -> Result < ( ) > {
211
211
if self . is_visible ( ) {
212
- if let AsyncGitNotification :: CommitFiles = ev {
212
+ if ev == AsyncGitNotification :: CommitFiles {
213
213
self . update ( ) ?;
214
- } else if let AsyncGitNotification :: Diff = ev {
214
+ } else if ev == AsyncGitNotification :: Diff {
215
215
self . update_diff ( ) ?;
216
216
}
217
217
}
Original file line number Diff line number Diff line change @@ -227,9 +227,9 @@ impl InspectCommitComponent {
227
227
ev : AsyncGitNotification ,
228
228
) -> Result < ( ) > {
229
229
if self . is_visible ( ) {
230
- if let AsyncGitNotification :: CommitFiles = ev {
230
+ if ev == AsyncGitNotification :: CommitFiles {
231
231
self . update ( ) ?;
232
- } else if let AsyncGitNotification :: Diff = ev {
232
+ } else if ev == AsyncGitNotification :: Diff {
233
233
self . update_diff ( ) ?;
234
234
}
235
235
}
Original file line number Diff line number Diff line change @@ -111,15 +111,13 @@ impl PullComponent {
111
111
112
112
///
113
113
pub fn update_git ( & mut self , ev : AsyncGitNotification ) {
114
- if self . is_visible ( ) {
115
- if let AsyncGitNotification :: Fetch = ev {
116
- if let Err ( error) = self . update ( ) {
117
- self . pending = false ;
118
- self . hide ( ) ;
119
- self . queue . push ( InternalEvent :: ShowErrorMsg (
120
- format ! ( "fetch failed:\n {}" , error) ,
121
- ) ) ;
122
- }
114
+ if self . is_visible ( ) && ev == AsyncGitNotification :: Fetch {
115
+ if let Err ( error) = self . update ( ) {
116
+ self . pending = false ;
117
+ self . hide ( ) ;
118
+ self . queue . push ( InternalEvent :: ShowErrorMsg (
119
+ format ! ( "fetch failed:\n {}" , error) ,
120
+ ) ) ;
123
121
}
124
122
}
125
123
}
Original file line number Diff line number Diff line change @@ -158,10 +158,8 @@ impl PushComponent {
158
158
& mut self ,
159
159
ev : AsyncGitNotification ,
160
160
) -> Result < ( ) > {
161
- if self . is_visible ( ) {
162
- if let AsyncGitNotification :: Push = ev {
163
- self . update ( ) ?;
164
- }
161
+ if self . is_visible ( ) && ev == AsyncGitNotification :: Push {
162
+ self . update ( ) ?;
165
163
}
166
164
167
165
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -101,10 +101,8 @@ impl PushTagsComponent {
101
101
& mut self ,
102
102
ev : AsyncGitNotification ,
103
103
) -> Result < ( ) > {
104
- if self . is_visible ( ) {
105
- if let AsyncGitNotification :: PushTags = ev {
106
- self . update ( ) ?;
107
- }
104
+ if self . is_visible ( ) && ev == AsyncGitNotification :: PushTags {
105
+ self . update ( ) ?;
108
106
}
109
107
110
108
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -91,11 +91,9 @@ impl Stashing {
91
91
& mut self ,
92
92
ev : AsyncGitNotification ,
93
93
) -> Result < ( ) > {
94
- if self . is_visible ( ) {
95
- if let AsyncGitNotification :: Status = ev {
96
- let status = self . git_status . last ( ) ?;
97
- self . index . update ( & status. items ) ?;
98
- }
94
+ if self . is_visible ( ) && ev == AsyncGitNotification :: Status {
95
+ let status = self . git_status . last ( ) ?;
96
+ self . index . update ( & status. items ) ?;
99
97
}
100
98
101
99
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl<'a> StatefulWidget for StatefulParagraph<'a> {
160
160
& mut styled,
161
161
text_area. width ,
162
162
) ) ;
163
- if let Alignment :: Left = self . alignment {
163
+ if self . alignment == Alignment :: Left {
164
164
line_composer
165
165
. set_horizontal_offset ( state. scroll . x ) ;
166
166
}
You can’t perform that action at this time.
0 commit comments