From 7d71f6a02a4bbd00805c91388f257198c1173912 Mon Sep 17 00:00:00 2001 From: M Farkas-Dyck Date: Sat, 18 Nov 2017 18:38:31 -0800 Subject: no_std (#9) --- utf8parse/src/lib.rs | 6 +++++- utf8parse/src/types.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'utf8parse/src') 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. /// -- cgit