From 6e5add39acd680f5fe741220b646f08f3d84c0aa Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 2 Jun 2024 01:12:17 +0700 Subject: [PATCH] Use lossy converter --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index 48f3a81..cd57da4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -18,7 +18,7 @@ pub fn rand() -> [u8; 50] { //? What is this guy doing pub fn bytes_into_string(code: &[u8]) -> String { // code.iter().map(|byte| format!("{:02x}", byte)).collect::() // ????? Why do you need this? Why not just String::from_utf8()?? - String::from_utf8(code.to_vec()).unwrap() // Unwrap might be unsafe here... + String::from_utf8_lossy(code).to_string() } // Конец кор функций