Skip to content

Commit 21c4d3e

Browse files
committed
Clean up some clippy lints
1 parent 19feabf commit 21c4d3e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/console.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ where
9393
if let Some(value) = iter.next() {
9494
let _ = write!(f, "{}", value as u8);
9595
}
96-
while let Some(value) = iter.next() {
96+
for value in iter {
9797
let _ = write!(f, ";{}", value as u8);
9898
}
9999
let _ = write!(f, "m");

src/fake_os_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extern "C" fn api_read(
105105
mut buffer: neotron_api::FfiBuffer,
106106
) -> neotron_api::Result<usize> {
107107
if fd == neotron_api::file::Handle::new_stdin() {
108-
if let Some(b) = STDIN_RX.lock().unwrap().as_mut().unwrap().try_recv().ok() {
108+
if let Ok(b) = STDIN_RX.lock().unwrap().as_mut().unwrap().try_recv() {
109109
buffer.as_mut_slice().unwrap()[0] = b;
110110
neotron_api::Result::Ok(1)
111111
} else {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pub fn srand(seed: u16) {
343343
/// Get a 16-bit psuedorandom number
344344
pub fn rand() -> u16 {
345345
let mut state = RAND_STATE.load(core::sync::atomic::Ordering::Relaxed);
346-
let bit = ((state >> 0) ^ (state >> 2) ^ (state >> 3) ^ (state >> 5)) & 0x01;
346+
let bit = (state ^ (state >> 2) ^ (state >> 3) ^ (state >> 5)) & 0x01;
347347
state = (state >> 1) | (bit << 15);
348348
RAND_STATE.store(state, core::sync::atomic::Ordering::Relaxed);
349349
state

0 commit comments

Comments
 (0)