Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.88" # STABLE
toolchain: "1.89" # STABLE
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
Expand All @@ -105,7 +105,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.88" # STABLE
toolchain: "1.89" # STABLE
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
Expand All @@ -121,7 +121,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.88" # STABLE
toolchain: "1.89" # STABLE
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install SARIF tools
Expand Down
32 changes: 0 additions & 32 deletions src/git2_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,38 +421,6 @@ pub(crate) trait Parseable: Sized {
fn parse(s: &str) -> anyhow::Result<Self>;
}

pub(crate) struct ParseWrapper<T>(pub(crate) T);

impl<T: std::fmt::Display> std::fmt::Display for ParseWrapper<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}

impl<T> std::str::FromStr for ParseWrapper<T>
where
T: std::str::FromStr,
T::Err: Into<anyhow::Error>,
{
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
T::from_str(s).map(ParseWrapper).map_err(|e| e.into())
}
}

impl<T> Parseable for ParseWrapper<T>
where
T: Parseable,
T: std::str::FromStr,
T: std::fmt::Display,
T::Err: Into<anyhow::Error>,
{
fn parse(s: &str) -> anyhow::Result<Self> {
<Self as std::str::FromStr>::from_str(s)
}
}

pub(crate) trait Field {
type Output;

Expand Down
Loading