Print string repr in io example
This commit is contained in:
parent
9d04b5e700
commit
5ba4dab3cf
1 changed files with 1 additions and 2 deletions
|
@ -39,10 +39,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
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::<String>();
|
||||
println!("{:?}: {}", std::thread::current().id(), string);
|
||||
string.push('\n');
|
||||
|
||||
if stream.write_all(string.as_bytes()).await.is_err() {
|
||||
|
|
Loading…
Reference in a new issue