mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 04:51:13 +03:00
Use lossy converter
This commit is contained in:
parent
4e63f7ce7a
commit
6e5add39ac
1 changed files with 1 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ pub fn rand() -> [u8; 50] {
|
||||||
//? What is this guy doing
|
//? What is this guy doing
|
||||||
pub fn bytes_into_string(code: &[u8]) -> String {
|
pub fn bytes_into_string(code: &[u8]) -> String {
|
||||||
// code.iter().map(|byte| format!("{:02x}", byte)).collect::<String>() // ????? Why do you need this? Why not just String::from_utf8()??
|
// code.iter().map(|byte| format!("{:02x}", byte)).collect::<String>() // ????? 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()
|
||||||
}
|
}
|
||||||
// Конец кор функций
|
// Конец кор функций
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue