Skip to content

Commit a815986

Browse files
committed
Simplifying stringification
1 parent 65af81b commit a815986

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,10 @@ where
301301
#[cfg(not(feature = "echo"))]
302302
{
303303
// Echo the command
304-
write!(context, "\r").unwrap();
305-
if let Ok(s) = core::str::from_utf8(&self.buffer[0..self.used]) {
306-
write!(context, "{}", s).unwrap();
307-
}
304+
context.write_all(b"\r").unwrap();
305+
context.write_all(&self.buffer[..self.used]).unwrap();
308306
}
307+
309308
// Handle the command
310309
self.process_command(context);
311310
Outcome::CommandProcessed

0 commit comments

Comments
 (0)