We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de059e7 commit 2dc2036Copy full SHA for 2dc2036
src/unix_term.rs
@@ -183,7 +183,7 @@ fn read_single_char(fd: i32) -> io::Result<Option<char>> {
183
// If successful, return the number of bytes read.
184
// Will return an error if nothing was read, i.e when called at end of file.
185
fn read_bytes(fd: i32, buf: &mut [u8], count: u8) -> io::Result<u8> {
186
- assert!(count < buf.len()); // Safety precondition - prevent reading past end of buffer.
+ assert!((count as usize) < buf.len()); // Safety precondition - prevent reading past end of buffer.
187
let read = unsafe { libc::read(fd, buf.as_mut_ptr() as *mut _, count as usize) };
188
if read < 0 {
189
Err(io::Error::last_os_error())
0 commit comments