fix: Remove unnecessary clones from encoding

Use references if possible

Took 3 minutes
This commit is contained in:
Diana Carvalho
2025-06-23 12:54:09 +01:00
parent ce8e9faf32
commit e704151404
11 changed files with 185 additions and 197 deletions

View File

@@ -48,7 +48,7 @@ pub fn percentage_to_uint24(decimal: f64) -> U24 {
}
/// Gets the position of a token in a list of tokens.
pub fn get_token_position(tokens: Vec<Bytes>, token: Bytes) -> Result<U8, EncodingError> {
pub fn get_token_position(tokens: &Vec<&Bytes>, token: &Bytes) -> Result<U8, EncodingError> {
let position = U8::from(
tokens
.iter()