feat(fn): edit function signature

This commit is contained in:
doryan 2024-08-10 00:39:11 +04:00
parent bf7f542df0
commit 2ce75224fa

View File

@ -6,8 +6,9 @@ use std::ops::Deref;
const ASCII_ZERO_CHAR_POSITION: u8 = 48; const ASCII_ZERO_CHAR_POSITION: u8 = 48;
pub fn processing_input(input: &String) -> String { pub fn processing_input(input: impl Into<String>) -> String {
input input
.into()
.split_ascii_whitespace() .split_ascii_whitespace()
.filter(|&x| !x.is_empty()) .filter(|&x| !x.is_empty())
.fold(String::new(), |c: String, n: &str| c + n) .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() .collect()
} }
pub fn from_string_to_vec_bits(raw_data: String) -> Vec<u8> { pub fn from_string_to_vec_bits(raw_data: impl Into<String>) -> Vec<u8> {
raw_data raw_data
.into()
.as_bits::<Lsb0>() .as_bits::<Lsb0>()
.iter() .iter()
.step_by(8) .step_by(8)