diff --git a/asyncgit/src/error.rs b/asyncgit/src/error.rs index 8bd730096e..2113e93d6e 100644 --- a/asyncgit/src/error.rs +++ b/asyncgit/src/error.rs @@ -1,5 +1,3 @@ -#![allow(renamed_and_removed_lints, clippy::unknown_clippy_lints)] - use std::{ num::TryFromIntError, path::StripPrefixError, string::FromUtf8Error, diff --git a/asyncgit/src/sync/config.rs b/asyncgit/src/sync/config.rs index 17a62b6736..9b5d85d823 100644 --- a/asyncgit/src/sync/config.rs +++ b/asyncgit/src/sync/config.rs @@ -1,6 +1,3 @@ -//TODO: hopefully released in next rust (see https://github.com/rust-lang/rust-clippy/issues/9440) -#![allow(clippy::use_self)] - use crate::error::Result; use git2::Repository; use scopetime::scope_time; diff --git a/asyncgit/src/sync/logwalker.rs b/asyncgit/src/sync/logwalker.rs index 743376d34f..b42447642c 100644 --- a/asyncgit/src/sync/logwalker.rs +++ b/asyncgit/src/sync/logwalker.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] use super::{CommitId, SharedCommitFilterFn}; use crate::error::Result; use git2::{Commit, Oid, Repository}; diff --git a/asyncgit/src/sync/patches.rs b/asyncgit/src/sync/patches.rs index e87a3c9777..4107dae4b5 100644 --- a/asyncgit/src/sync/patches.rs +++ b/asyncgit/src/sync/patches.rs @@ -2,14 +2,12 @@ use super::diff::{get_diff_raw, DiffOptions, HunkHeader}; use crate::error::{Error, Result}; use git2::{Diff, DiffLine, Patch, Repository}; -#[allow(clippy::redundant_pub_crate)] -pub(crate) struct HunkLines<'a> { +pub struct HunkLines<'a> { pub hunk: HunkHeader, pub lines: Vec>, } -#[allow(clippy::redundant_pub_crate)] -pub(crate) fn get_file_diff_patch<'a>( +pub fn get_file_diff_patch<'a>( repo: &'a Repository, file: &str, is_staged: bool, diff --git a/asyncgit/src/sync/staging/mod.rs b/asyncgit/src/sync/staging/mod.rs index d037499a07..06e09fe66b 100644 --- a/asyncgit/src/sync/staging/mod.rs +++ b/asyncgit/src/sync/staging/mod.rs @@ -68,9 +68,9 @@ impl NewFromOldContent { } } -// this is the heart of the per line discard,stage,unstage. heavily inspired by the great work in nodegit: https://github.com/nodegit/nodegit -#[allow(clippy::redundant_pub_crate)] -pub(crate) fn apply_selection( +// this is the heart of the per line discard,stage,unstage. heavily inspired by the great work in +// nodegit: https://github.com/nodegit/nodegit +pub fn apply_selection( lines: &[DiffLinePosition], hunks: &[HunkLines], old_lines: &[&str], diff --git a/filetreelist/src/error.rs b/filetreelist/src/error.rs index 068db8b4c8..7c929e37e0 100644 --- a/filetreelist/src/error.rs +++ b/filetreelist/src/error.rs @@ -1,5 +1,3 @@ -#![allow(renamed_and_removed_lints, clippy::unknown_clippy_lints)] - use std::{num::TryFromIntError, path::PathBuf}; use thiserror::Error; diff --git a/filetreelist/src/filetreeitems.rs b/filetreelist/src/filetreeitems.rs index 8547d37032..637bfb3781 100644 --- a/filetreelist/src/filetreeitems.rs +++ b/filetreelist/src/filetreeitems.rs @@ -144,8 +144,6 @@ impl FileTreeItems { let item_path = Path::new(item.info().full_path_str()); - //TODO: fix once FP in clippy is fixed - #[allow(clippy::needless_borrow)] if item_path.starts_with(&path) { item.hide(); } else { diff --git a/src/components/utils/emoji.rs b/src/components/utils/emoji.rs index 75fe84dc5d..3980cd30b3 100644 --- a/src/components/utils/emoji.rs +++ b/src/components/utils/emoji.rs @@ -7,9 +7,10 @@ static EMOJI_REPLACER: Lazy = // Replace markdown emojis with Unicode equivalent // :hammer: --> 🔨 #[inline] -pub fn emojifi_string(s: &mut String) { - let resulting_cow = EMOJI_REPLACER.replace_all(s); - if let Cow::Owned(altered_s) = resulting_cow { - *s = altered_s; +pub fn emojifi_string(s: String) -> String { + if let Cow::Owned(altered_s) = EMOJI_REPLACER.replace_all(&s) { + altered_s + } else { + s } } diff --git a/src/components/utils/logitems.rs b/src/components/utils/logitems.rs index 4c980b65fa..9e0706226e 100644 --- a/src/components/utils/logitems.rs +++ b/src/components/utils/logitems.rs @@ -41,12 +41,11 @@ impl From for LogEntry { }; let author = c.author; - #[allow(unused_mut)] - let mut msg = c.message; + let msg = c.message; // Replace markdown emojis with Unicode equivalent #[cfg(feature = "ghemoji")] - emojifi_string(&mut msg); + let msg = emojifi_string(msg); Self { author: author.into(), @@ -175,9 +174,7 @@ mod tests { use super::*; fn test_conversion(s: &str) -> String { - let mut s = s.to_string(); - emojifi_string(&mut s); - s + emojifi_string(s.into()) } #[test] diff --git a/src/options.rs b/src/options.rs index db04802092..0fafe64151 100644 --- a/src/options.rs +++ b/src/options.rs @@ -152,8 +152,6 @@ impl Options { Ok(from_bytes(&buffer)?) } - //TODO: fix once FP in clippy is fixed - #[allow(clippy::needless_borrow)] fn save_failable(&self) -> Result<()> { let dir = Self::options_file(&self.repo)?;