diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c5bd22..36761ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,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: @@ -123,7 +123,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 @@ -139,7 +139,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 diff --git a/src/testing.rs b/src/testing.rs index 4948dcc..2d75344 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -85,35 +85,6 @@ pub(crate) struct GitRunOptions { pub(crate) env: HashMap, } -/// The parsed version of Git. -#[derive(Debug, PartialEq, PartialOrd, Eq)] -pub(crate) struct GitVersion(pub(crate) isize, pub(crate) isize, pub(crate) isize); - -impl std::str::FromStr for GitVersion { - type Err = eyre::Error; - - fn from_str(output: &str) -> eyre::Result { - let output = output.trim(); - let words = output.split(&[' ', '-'][..]).collect::>(); - let version_str = match &words.as_slice() { - [_git, _version, version_str, ..] => version_str, - _ => eyre::bail!("Could not parse Git version output: {:?}", output), - }; - match version_str.split('.').collect::>().as_slice() { - [major, minor, patch, ..] => { - let major = major.parse()?; - let minor = minor.parse()?; - - // Example version without a real patch number: `2.33.GIT`. - let patch: isize = patch.parse().unwrap_or_default(); - - Ok(GitVersion(major, minor, patch)) - } - _ => eyre::bail!("Could not parse Git version string: {}", version_str), - } - } -} - impl Git { /// Constructor. pub(crate) fn new(git_run_info: GitRunInfo, repo_path: PathBuf) -> Self {