diff --git a/crates/cli/src/tui/components/configured_app.rs b/crates/cli/src/tui/components/configured_app.rs index 114a161..64b3f8d 100644 --- a/crates/cli/src/tui/components/configured_app.rs +++ b/crates/cli/src/tui/components/configured_app.rs @@ -15,7 +15,7 @@ use super::{forge::ForgeWidget, HeightContraintLength}; pub struct ConfiguredAppWidget<'a> { pub forges: &'a BTreeMap, } -impl<'a> HeightContraintLength for ConfiguredAppWidget<'a> { +impl HeightContraintLength for ConfiguredAppWidget<'_> { fn height_constraint_length(&self) -> u16 { self.children() .iter() @@ -24,7 +24,7 @@ impl<'a> HeightContraintLength for ConfiguredAppWidget<'a> { + 2 // top + bottom borders } } -impl<'a> StatefulWidget for ConfiguredAppWidget<'a> { +impl StatefulWidget for ConfiguredAppWidget<'_> { type State = ScrollViewState; fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) diff --git a/crates/cli/src/tui/components/forge/collapsed.rs b/crates/cli/src/tui/components/forge/collapsed.rs index 3245efc..707054f 100644 --- a/crates/cli/src/tui/components/forge/collapsed.rs +++ b/crates/cli/src/tui/components/forge/collapsed.rs @@ -7,12 +7,12 @@ use crate::tui::components::HeightContraintLength; pub struct CollapsedForgeWidget<'a> { pub forge_alias: &'a ForgeAlias, } -impl<'a> HeightContraintLength for CollapsedForgeWidget<'a> { +impl HeightContraintLength for CollapsedForgeWidget<'_> { fn height_constraint_length(&self) -> u16 { 1 } } -impl<'a> Widget for CollapsedForgeWidget<'a> { +impl Widget for CollapsedForgeWidget<'_> { fn render(self, area: Rect, buf: &mut Buffer) where Self: Sized, diff --git a/crates/cli/src/tui/components/forge/expanded.rs b/crates/cli/src/tui/components/forge/expanded.rs index 2d52d41..347215e 100644 --- a/crates/cli/src/tui/components/forge/expanded.rs +++ b/crates/cli/src/tui/components/forge/expanded.rs @@ -18,7 +18,7 @@ pub struct ExpandedForgeWidget<'a> { pub forge_alias: &'a ForgeAlias, pub repos: &'a BTreeMap, } -impl<'a> HeightContraintLength for ExpandedForgeWidget<'a> { +impl HeightContraintLength for ExpandedForgeWidget<'_> { fn height_constraint_length(&self) -> u16 { self.children() .iter() @@ -27,7 +27,7 @@ impl<'a> HeightContraintLength for ExpandedForgeWidget<'a> { + 2 // top title + bottom padding } } -impl<'a> Widget for ExpandedForgeWidget<'a> { +impl Widget for ExpandedForgeWidget<'_> { fn render(self, area: Rect, buf: &mut Buffer) where Self: Sized, diff --git a/crates/cli/src/tui/components/forge/mod.rs b/crates/cli/src/tui/components/forge/mod.rs index afce0e8..0bc9afc 100644 --- a/crates/cli/src/tui/components/forge/mod.rs +++ b/crates/cli/src/tui/components/forge/mod.rs @@ -18,7 +18,7 @@ pub struct ForgeWidget<'a> { pub repos: &'a BTreeMap, pub view_state: ViewState, } -impl<'a> HeightContraintLength for ForgeWidget<'a> { +impl HeightContraintLength for ForgeWidget<'_> { fn height_constraint_length(&self) -> u16 { match self.view_state { ViewState::Collapsed => CollapsedForgeWidget { @@ -33,7 +33,7 @@ impl<'a> HeightContraintLength for ForgeWidget<'a> { } } } -impl<'a> Widget for ForgeWidget<'a> { +impl Widget for ForgeWidget<'_> { fn render(self, area: Rect, buf: &mut Buffer) where Self: Sized, diff --git a/crates/cli/src/tui/components/history.rs b/crates/cli/src/tui/components/history.rs index f18f270..386d8d9 100644 --- a/crates/cli/src/tui/components/history.rs +++ b/crates/cli/src/tui/components/history.rs @@ -12,12 +12,12 @@ use super::HeightContraintLength; pub struct CommitLog<'a> { pub log: &'a Log, } -impl<'a> HeightContraintLength for CommitLog<'a> { +impl HeightContraintLength for CommitLog<'_> { fn height_constraint_length(&self) -> u16 { u16::try_from(self.log.len()).unwrap_or(u16::MAX) } } -impl<'a> Widget for CommitLog<'a> { +impl Widget for CommitLog<'_> { fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) where Self: Sized, diff --git a/crates/cli/src/tui/components/repo/mod.rs b/crates/cli/src/tui/components/repo/mod.rs index 349dc1d..5eacd0a 100644 --- a/crates/cli/src/tui/components/repo/mod.rs +++ b/crates/cli/src/tui/components/repo/mod.rs @@ -26,12 +26,12 @@ use super::HeightContraintLength; pub struct RepoWidget<'a> { pub repo_state: &'a RepoState, } -impl<'a> HeightContraintLength for RepoWidget<'a> { +impl HeightContraintLength for RepoWidget<'_> { fn height_constraint_length(&self) -> u16 { self.inner().height_constraint_length() + 2 // top + bottom borders } } -impl<'a> RepoWidget<'a> { +impl RepoWidget<'_> { fn inner(&self) -> InnerRepoWidget { match self.repo_state { RepoState::Identified { @@ -70,7 +70,7 @@ impl<'a> RepoWidget<'a> { } } } -impl<'a> Widget for RepoWidget<'a> { +impl Widget for RepoWidget<'_> { fn render(self, area: Rect, buf: &mut Buffer) where Self: Sized, @@ -86,14 +86,14 @@ struct InnerRepoWidget<'a> { pub branches: Option<&'a RepoBranches>, pub log: Option<&'a git::graph::Log>, } -impl<'a> HeightContraintLength for InnerRepoWidget<'a> { +impl HeightContraintLength for InnerRepoWidget<'_> { fn height_constraint_length(&self) -> u16 { self.log .map(|log| CommitLog { log }) .map_or(0, |w| w.height_constraint_length()) } } -impl<'a> Widget for InnerRepoWidget<'a> { +impl Widget for InnerRepoWidget<'_> { fn render(self, area: Rect, buf: &mut Buffer) where Self: Sized, diff --git a/crates/core/src/git/validation/remotes.rs b/crates/core/src/git/validation/remotes.rs index 66f2e2c..2b5fa20 100644 --- a/crates/core/src/git/validation/remotes.rs +++ b/crates/core/src/git/validation/remotes.rs @@ -13,10 +13,10 @@ pub fn validate_default_remotes( ) -> Result<()> { let push_remote = open_repository .find_default_remote(git::repository::Direction::Push) - .ok_or_else(|| Error::NoDefaultPushRemote)?; + .ok_or(Error::NoDefaultPushRemote)?; let fetch_remote = open_repository .find_default_remote(git::repository::Direction::Fetch) - .ok_or_else(|| Error::NoDefaultFetchRemote)?; + .ok_or(Error::NoDefaultFetchRemote)?; let Some(remote_url) = repo_details.remote_url() else { return Err(git::validation::remotes::Error::UnableToOpenRepo( "Unable to build forge url".to_string(),