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
2 changes: 0 additions & 2 deletions asyncgit/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(renamed_and_removed_lints, clippy::unknown_clippy_lints)]

use std::{
num::TryFromIntError, path::StripPrefixError,
string::FromUtf8Error,
Expand Down
3 changes: 0 additions & 3 deletions asyncgit/src/sync/config.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion asyncgit/src/sync/logwalker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use super::{CommitId, SharedCommitFilterFn};
use crate::error::Result;
use git2::{Commit, Oid, Repository};
Expand Down
6 changes: 2 additions & 4 deletions asyncgit/src/sync/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DiffLine<'a>>,
}

#[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,
Expand Down
6 changes: 3 additions & 3 deletions asyncgit/src/sync/staging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 0 additions & 2 deletions filetreelist/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(renamed_and_removed_lints, clippy::unknown_clippy_lints)]

use std::{num::TryFromIntError, path::PathBuf};
use thiserror::Error;

Expand Down
2 changes: 0 additions & 2 deletions filetreelist/src/filetreeitems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions src/components/utils/emoji.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ static EMOJI_REPLACER: Lazy<gh_emoji::Replacer> =
// 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
}
}
9 changes: 3 additions & 6 deletions src/components/utils/logitems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ impl From<CommitInfo> 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(),
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down
Loading