From c72ba3d69b1530e9b2f03982bd45c76f071334cd Mon Sep 17 00:00:00 2001 From: ElectronicPanopticon Date: Tue, 3 Oct 2023 10:06:34 -0700 Subject: [PATCH] Fixed issues on audit --- .github/workflows/CI.yaml | 8 ++++---- .github/workflows/audit.yml | 2 +- Cargo.toml | 4 ++-- clippy.toml | 2 +- src/cards/pile.rs | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 99f3f8d..6f30c7e 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -17,13 +17,13 @@ jobs: strategy: fail-fast: false matrix: - rust: [beta, stable, 1.63.0] + rust: [beta, stable, 1.66.0] include: - rust: nightly rustflags: --cfg thiserror_nightly_testing timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} @@ -38,7 +38,7 @@ jobs: if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable @@ -51,7 +51,7 @@ jobs: if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index daddf4f..4ef6edf 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -12,7 +12,7 @@ jobs: name: SecurityAudit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: taiki-e/install-action@cargo-deny - name: Scan for vulnerabilities run: cargo deny check advisories diff --git a/Cargo.toml b/Cargo.toml index 84810c4..99a87d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "cardpack" description = "Generic Deck of Cards" -version = "0.4.19" +version = "0.4.20" authors = ["electronicpanopticon "] repository = "https://github.com/ImperialBower/cardpack.rs.git" homepage = "https://github.com/ImperialBower/cardpack.rs" edition = "2021" -rust-version = "1.63" +rust-version = "1.66" license = "Apache-2.0" exclude = [".github/workflows/*", "examples/*", ".gitignore", ".travis.yml", "Cargo.lock"] diff --git a/clippy.toml b/clippy.toml index 3431f9e..ff36ff0 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,4 +1,4 @@ -msrv = "1.63" +msrv = "1.66" cognitive-complexity-threshold = 30 diff --git a/src/cards/pile.rs b/src/cards/pile.rs index e50ec1f..4938a82 100644 --- a/src/cards/pile.rs +++ b/src/cards/pile.rs @@ -3,6 +3,7 @@ use rand::thread_rng; use std::collections::HashMap; use std::collections::HashSet; use std::fmt; +use std::fmt::Write; use std::iter::FromIterator; use unic_langid::LanguageIdentifier; @@ -639,12 +640,11 @@ impl Pile { #[must_use] pub fn sig_generate_from_strings(strings: &[String]) -> String { - strings - .iter() - .map(|s| format!("{s} ")) - .collect::() - .trim_end() - .to_string() + let out = strings.iter().fold(String::new(), |mut output, s| { + let _ = write!(output, "{s} "); + output + }); + out.trim_end().to_string() } }