pub fn bytes_to_string(bytes: &[u8]) -> StringExpand description
Convert bytes to string, escaping non-printable characters
ยงExample
use tuiserial_serial::bytes_to_string;
let s = bytes_to_string(&[0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x0A]);
assert_eq!(s, "Hello\\x0A");