chore: enable clippy::trivially_copy_pass_by_ref lint and address it (#6724)

This commit is contained in:
Sanchith Hegde
2024-12-05 20:11:40 +05:30
committed by GitHub
parent e5dde6acc0
commit d17d2fe075
154 changed files with 423 additions and 429 deletions

View File

@ -47,7 +47,7 @@ use thiserror::Error;
use crate::{fp_utils::when, generate_id_with_default_len};
#[inline]
fn is_valid_id_character(input_char: &char) -> bool {
fn is_valid_id_character(input_char: char) -> bool {
input_char.is_ascii_alphanumeric() || matches!(input_char, '_' | '-')
}
@ -57,7 +57,7 @@ fn get_invalid_input_character(input_string: Cow<'static, str>) -> Option<char>
input_string
.trim()
.chars()
.find(|char| !is_valid_id_character(char))
.find(|&char| !is_valid_id_character(char))
}
#[derive(Debug, PartialEq, Hash, Serialize, Clone, Eq)]

View File

@ -29,7 +29,7 @@ pub(crate) enum GlobalEntity {
}
impl GlobalEntity {
fn prefix(&self) -> &'static str {
fn prefix(self) -> &'static str {
match self {
Self::Customer => "cus",
Self::Payment => "pay",

View File

@ -375,7 +375,7 @@ pub struct MinorUnit(i64);
impl MinorUnit {
/// gets amount as i64 value will be removed in future
pub fn get_amount_as_i64(&self) -> i64 {
pub fn get_amount_as_i64(self) -> i64 {
self.0
}