diff --git a/Cargo.toml b/Cargo.toml index d47f998..1f93c79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,6 @@ edition = "2018" version = "0.3.1" authors = ["wycats", "rustasync"] + +[dependencies] +sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["net"] } \ No newline at end of file diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..27df7dc --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly-2021-05-11 \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 0df75b0..27fbce4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,10 +44,21 @@ #![doc(html_favicon_url = "https://yoshuawuyts.com/assets/http-rs/favicon.ico")] #![doc(html_logo_url = "https://yoshuawuyts.com/assets/http-rs/logo-rounded.png")] + +// ensure we don't import any parts of the std library - we use sgx_tstd instead +#![no_std] +#[macro_use] +extern crate sgx_tstd as std; + use std::cmp::Ordering; -use std::collections::{btree_map, BTreeMap}; +use std::collections::{btree_map, btree_map::BTreeMap}; use std::ops::Index; +use std::{ + vec::Vec, + string::{String, ToString} +}; + use crate::nfa::{CharacterClass, NFA}; #[doc(hidden)] diff --git a/src/nfa.rs b/src/nfa.rs index 7d6df04..ca578e1 100644 --- a/src/nfa.rs +++ b/src/nfa.rs @@ -1,3 +1,9 @@ +use sgx_tstd as std; +use std::{ + string::{String, ToString}, + vec::Vec, +}; + use std::collections::HashSet; use self::CharacterClass::{Ascii, InvalidChars, ValidChars};