mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Drop some unnecessary imports
This commit is contained in:
parent
54f653865f
commit
bb1693556b
1 changed files with 4 additions and 7 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue