mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 00:48:35 +00:00
Fixing the CI Pipeline
Rust nightly (1.57.0-nightly) was throwing errors when running `cargo clippy`.
This commit is contained in:
parent
d84120a895
commit
8486233053
9 changed files with 23 additions and 35 deletions
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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()?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue