diff options
-rw-r--r-- | src/definitions.rs | 4 | ||||
-rw-r--r-- | src/lib.rs | 6 | ||||
-rw-r--r-- | utf8parse/src/lib.rs | 6 | ||||
-rw-r--r-- | utf8parse/src/types.rs | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/definitions.rs b/src/definitions.rs index d8faf53..3cfa7de 100644 --- a/src/definitions.rs +++ b/src/definitions.rs @@ -51,10 +51,10 @@ pub enum Action { pub fn unpack(delta: u8) -> (State, Action) { ( // State is stored in bottom 4 bits - unsafe { ::std::mem::transmute(delta & 0x0f) }, + unsafe { ::core::mem::transmute(delta & 0x0f) }, // Action is stored in top 4 bits - unsafe { ::std::mem::transmute(delta >> 4) }, + unsafe { ::core::mem::transmute(delta >> 4) }, ) } @@ -30,9 +30,11 @@ //! [`Parser`]: struct.Parser.html //! [`Perform`]: trait.Perform.html //! [Paul Williams' ANSI parser state machine]: http://vt100.net/emu/dec_ansi_parser +#![no_std] + extern crate utf8parse as utf8; -use std::mem; +use core::mem; mod table; mod definitions; @@ -414,7 +416,7 @@ pub trait Perform { #[cfg(test)] mod tests { use super::{Parser, Perform}; - use std::i64; + use core::i64; static OSC_BYTES: &'static [u8] = &[0x1b, 0x5d, // Begin OSC b'2', b';', b'j', b'w', b'i', b'l', b'm', b'@', b'j', b'w', b'i', b'l', diff --git a/utf8parse/src/lib.rs b/utf8parse/src/lib.rs index e75f197..dc4b0fa 100644 --- a/utf8parse/src/lib.rs +++ b/utf8parse/src/lib.rs @@ -3,7 +3,9 @@ //! This module implements a table-driven UTF-8 parser which should //! theoretically contain the minimal number of branches (1). The only branch is //! on the `Action` returned from unpacking a transition. -use std::char; +#![no_std] + +use core::char; mod types; use self::types::{State, Action, unpack}; @@ -94,6 +96,8 @@ impl Parser { #[cfg(test)] mod tests { + extern crate std; + use std::io::Read; use std::fs::File; use Receiver; diff --git a/utf8parse/src/types.rs b/utf8parse/src/types.rs index 4c604f4..a5b9436 100644 --- a/utf8parse/src/types.rs +++ b/utf8parse/src/types.rs @@ -1,6 +1,6 @@ //! Types supporting the UTF-8 parser #![allow(non_camel_case_types)] -use std::mem; +use core::mem; /// States the parser can be in. /// |