From 5ba4dab3cfbc33a65ac96ef2e4d5ad8ef6dd8907 Mon Sep 17 00:00:00 2001 From: "Aode (Lion)" Date: Fri, 11 Feb 2022 15:15:00 -0600 Subject: [PATCH] Print string repr in io example --- examples/io.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/io.rs b/examples/io.rs index 0ea3b2f..c73efdd 100644 --- a/examples/io.rs +++ b/examples/io.rs @@ -39,10 +39,9 @@ fn main() -> Result<(), Box> { break; } - println!("{:?}: {:?}", std::thread::current().id(), &buffer[0..n]); - if let Ok(s) = std::str::from_utf8(&buffer[0..n]) { let mut string = s.trim().chars().rev().collect::(); + println!("{:?}: {}", std::thread::current().id(), string); string.push('\n'); if stream.write_all(string.as_bytes()).await.is_err() {