Skip to content

Commit 8486233

Browse files
alessandroasmStephan Dilly
authored and
Stephan Dilly
committed
Fixing the CI Pipeline
Rust nightly (1.57.0-nightly) was throwing errors when running `cargo clippy`.
1 parent d84120a commit 8486233

9 files changed

+23
-35
lines changed

Diff for: src/components/blame_file.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,8 @@ impl BlameFileComponent {
286286
&mut self,
287287
event: AsyncGitNotification,
288288
) -> 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()?;
293291
}
294292

295293
Ok(())

Diff for: src/components/branchlist.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,8 @@ impl BranchListComponent {
350350
&mut self,
351351
ev: AsyncGitNotification,
352352
) -> 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()?;
357355
}
358356

359357
Ok(())

Diff for: src/components/compare_commits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ impl CompareCommitsComponent {
209209
ev: AsyncGitNotification,
210210
) -> Result<()> {
211211
if self.is_visible() {
212-
if let AsyncGitNotification::CommitFiles = ev {
212+
if ev == AsyncGitNotification::CommitFiles {
213213
self.update()?;
214-
} else if let AsyncGitNotification::Diff = ev {
214+
} else if ev == AsyncGitNotification::Diff {
215215
self.update_diff()?;
216216
}
217217
}

Diff for: src/components/inspect_commit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ impl InspectCommitComponent {
227227
ev: AsyncGitNotification,
228228
) -> Result<()> {
229229
if self.is_visible() {
230-
if let AsyncGitNotification::CommitFiles = ev {
230+
if ev == AsyncGitNotification::CommitFiles {
231231
self.update()?;
232-
} else if let AsyncGitNotification::Diff = ev {
232+
} else if ev == AsyncGitNotification::Diff {
233233
self.update_diff()?;
234234
}
235235
}

Diff for: src/components/pull.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,13 @@ impl PullComponent {
111111

112112
///
113113
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+
));
123121
}
124122
}
125123
}

Diff for: src/components/push.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,8 @@ impl PushComponent {
158158
&mut self,
159159
ev: AsyncGitNotification,
160160
) -> 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()?;
165163
}
166164

167165
Ok(())

Diff for: src/components/push_tags.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ impl PushTagsComponent {
101101
&mut self,
102102
ev: AsyncGitNotification,
103103
) -> 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()?;
108106
}
109107

110108
Ok(())

Diff for: src/tabs/stashing.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ impl Stashing {
9191
&mut self,
9292
ev: AsyncGitNotification,
9393
) -> 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)?;
9997
}
10098

10199
Ok(())

Diff for: src/ui/stateful_paragraph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a> StatefulWidget for StatefulParagraph<'a> {
160160
&mut styled,
161161
text_area.width,
162162
));
163-
if let Alignment::Left = self.alignment {
163+
if self.alignment == Alignment::Left {
164164
line_composer
165165
.set_horizontal_offset(state.scroll.x);
166166
}

0 commit comments

Comments
 (0)