diff --git a/examples/cli/false-interpreter/platform/src/lib.rs b/examples/cli/false-interpreter/platform/src/lib.rs index b0fa94a555..d1b1b2db34 100644 --- a/examples/cli/false-interpreter/platform/src/lib.rs +++ b/examples/cli/false-interpreter/platform/src/lib.rs @@ -2,7 +2,7 @@ use core::alloc::Layout; use core::ffi::c_void; -use core::mem::{ManuallyDrop, MaybeUninit}; +use core::mem::MaybeUninit; use libc; use roc_std::{RocList, RocStr}; use std::env; @@ -157,9 +157,7 @@ unsafe fn call_the_closure(closure_data_ptr: *const u8) -> i64 { #[no_mangle] pub extern "C" fn roc_fx_getLine() -> RocStr { - use std::io::{self, BufRead}; - - let stdin = io::stdin(); + let stdin = std::io::stdin(); let line1 = stdin.lock().lines().next().unwrap().unwrap(); RocStr::from(line1.as_str()) @@ -167,11 +165,10 @@ pub extern "C" fn roc_fx_getLine() -> RocStr { #[no_mangle] pub extern "C" fn roc_fx_getChar() -> u8 { - use std::io::{self, BufRead}; let mut buffer = [0]; - if let Err(ioerr) = io::stdin().lock().read_exact(&mut buffer[..]) { - if ioerr.kind() == io::ErrorKind::UnexpectedEof { + if let Err(ioerr) = std::io::stdin().lock().read_exact(&mut buffer[..]) { + if ioerr.kind() == std::io::ErrorKind::UnexpectedEof { u8::MAX } else { panic!("Got an unexpected error while reading char from stdin");