Fixing the CI Pipeline

Rust nightly (1.57.0-nightly) was throwing errors when running `cargo clippy`.
This commit is contained in:
Alessandro Menezes 2021-10-09 18:25:43 -04:00 committed by Stephan Dilly
parent d84120a895
commit 8486233053
9 changed files with 23 additions and 35 deletions

View file

@ -286,10 +286,8 @@ impl BlameFileComponent {
&mut self,
event: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::Blame = event {
self.update()?;
}
if self.is_visible() && event == AsyncGitNotification::Blame {
self.update()?;
}
Ok(())

View file

@ -350,10 +350,8 @@ impl BranchListComponent {
&mut self,
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::Push = ev {
self.update_branches()?;
}
if self.is_visible() && ev == AsyncGitNotification::Push {
self.update_branches()?;
}
Ok(())

View file

@ -209,9 +209,9 @@ impl CompareCommitsComponent {
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::CommitFiles = ev {
if ev == AsyncGitNotification::CommitFiles {
self.update()?;
} else if let AsyncGitNotification::Diff = ev {
} else if ev == AsyncGitNotification::Diff {
self.update_diff()?;
}
}

View file

@ -227,9 +227,9 @@ impl InspectCommitComponent {
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::CommitFiles = ev {
if ev == AsyncGitNotification::CommitFiles {
self.update()?;
} else if let AsyncGitNotification::Diff = ev {
} else if ev == AsyncGitNotification::Diff {
self.update_diff()?;
}
}

View file

@ -111,15 +111,13 @@ impl PullComponent {
///
pub fn update_git(&mut self, ev: AsyncGitNotification) {
if self.is_visible() {
if let AsyncGitNotification::Fetch = ev {
if let Err(error) = self.update() {
self.pending = false;
self.hide();
self.queue.push(InternalEvent::ShowErrorMsg(
format!("fetch failed:\n{}", error),
));
}
if self.is_visible() && ev == AsyncGitNotification::Fetch {
if let Err(error) = self.update() {
self.pending = false;
self.hide();
self.queue.push(InternalEvent::ShowErrorMsg(
format!("fetch failed:\n{}", error),
));
}
}
}

View file

@ -158,10 +158,8 @@ impl PushComponent {
&mut self,
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::Push = ev {
self.update()?;
}
if self.is_visible() && ev == AsyncGitNotification::Push {
self.update()?;
}
Ok(())

View file

@ -101,10 +101,8 @@ impl PushTagsComponent {
&mut self,
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::PushTags = ev {
self.update()?;
}
if self.is_visible() && ev == AsyncGitNotification::PushTags {
self.update()?;
}
Ok(())

View file

@ -91,11 +91,9 @@ impl Stashing {
&mut self,
ev: AsyncGitNotification,
) -> Result<()> {
if self.is_visible() {
if let AsyncGitNotification::Status = ev {
let status = self.git_status.last()?;
self.index.update(&status.items)?;
}
if self.is_visible() && ev == AsyncGitNotification::Status {
let status = self.git_status.last()?;
self.index.update(&status.items)?;
}
Ok(())

View file

@ -160,7 +160,7 @@ impl<'a> StatefulWidget for StatefulParagraph<'a> {
&mut styled,
text_area.width,
));
if let Alignment::Left = self.alignment {
if self.alignment == Alignment::Left {
line_composer
.set_horizontal_offset(state.scroll.x);
}