From 06edab617ac498511d8feed96516cbd835c8e40d Mon Sep 17 00:00:00 2001 From: Frank Hamand Date: Tue, 1 Apr 2025 15:47:25 +0100 Subject: [PATCH] fix: add redundant clones to clippy and cleanup instances of it (#2654) --- .github/workflows/rust.yml | 2 +- crates/atuin-dotfiles/src/shell.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e0f8ee4c..510fd60a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -212,7 +212,7 @@ jobs: key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} - name: Run clippy - run: cargo clippy -- -D warnings + run: cargo clippy -- -D warnings -D clippy::redundant_clone format: runs-on: ubuntu-latest diff --git a/crates/atuin-dotfiles/src/shell.rs b/crates/atuin-dotfiles/src/shell.rs index d7762b3c..bd61aafa 100644 --- a/crates/atuin-dotfiles/src/shell.rs +++ b/crates/atuin-dotfiles/src/shell.rs @@ -98,12 +98,12 @@ pub fn parse_alias(line: &str) -> Option { let mut parts = parts.iter().map(|s| s.to_string()); - let name = parts.next().unwrap().to_string(); + let name = parts.next().unwrap(); let remaining = if is_fish { - parts.collect::>().join(" ").to_string() + parts.collect::>().join(" ") } else { - parts.collect::>().join("=").to_string() + parts.collect::>().join("=") }; Some(Alias {