Skip to content

Commit a37c5a5

Browse files
committed
vexos: simplify logic by casting count to usize early
1 parent 0c35573 commit a37c5a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/sys/stdio/vexos.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ impl io::Write for Stdout {
5656

5757
let count = unsafe {
5858
vex_sdk::vexSerialWriteBuffer(STDIO_CHANNEL, chunk.as_ptr(), chunk.len() as u32)
59+
as usize;
5960
};
6061
if count < 0 {
6162
return Err(io::Error::new(
@@ -77,7 +78,7 @@ impl io::Write for Stdout {
7778
}
7879
}
7980

80-
Ok(written as usize)
81+
Ok(written)
8182
}
8283

8384
fn flush(&mut self) -> io::Result<()> {

0 commit comments

Comments
 (0)