Drop some unnecessary imports

This commit is contained in:
Richard Feldman 2022-10-16 18:36:22 -04:00
parent 54f653865f
commit bb1693556b
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -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");