From 2ce75224fa08ba8336ba11cd16ca2a55345d5eeb Mon Sep 17 00:00:00 2001 From: doryan Date: Sat, 10 Aug 2024 00:39:11 +0400 Subject: [PATCH] feat(fn): edit function signature --- src/controller/view_utils/input_utils.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/view_utils/input_utils.rs b/src/controller/view_utils/input_utils.rs index 6e58f48..921ff42 100644 --- a/src/controller/view_utils/input_utils.rs +++ b/src/controller/view_utils/input_utils.rs @@ -6,8 +6,9 @@ use std::ops::Deref; const ASCII_ZERO_CHAR_POSITION: u8 = 48; -pub fn processing_input(input: &String) -> String { +pub fn processing_input(input: impl Into) -> String { input + .into() .split_ascii_whitespace() .filter(|&x| !x.is_empty()) .fold(String::new(), |c: String, n: &str| c + n) @@ -20,8 +21,9 @@ pub fn from_vec_bits_to_string(raw_data: &[u8]) -> String { .collect() } -pub fn from_string_to_vec_bits(raw_data: String) -> Vec { +pub fn from_string_to_vec_bits(raw_data: impl Into) -> Vec { raw_data + .into() .as_bits::() .iter() .step_by(8)