mirror of
https://github.com/gitui-org/gitui.git
synced 2026-10-12 02:14:16 +00:00
Clean up a few #[allow]s (#2614)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
@@ -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]
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user