mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
chore: enable clippy::trivially_copy_pass_by_ref lint and address it (#6724)
This commit is contained in:
@ -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)]
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user