aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Chris Beck <beck.ct@gmail.com> 2019-09-05 14:00:23 -0700
committerGravatar Carl Lerche <me@carllerche.com> 2019-09-05 14:00:23 -0700
commitc17e40115f5bb2a2db71ed90dceae6ec643dc024 (patch)
tree5457d4a726f8e16120c02976fa8b07caf07df0f1 /src/lib.rs
parent73426dfaa3e56884977d7822b79696ac2cc96a42 (diff)
downloadbytes-c17e40115f5bb2a2db71ed90dceae6ec643dc024.tar.gz
bytes-c17e40115f5bb2a2db71ed90dceae6ec643dc024.tar.zst
bytes-c17e40115f5bb2a2db71ed90dceae6ec643dc024.zip
Add no_std support, by adding an `std` feature (#281)
To make the library work as `no_std` we add an `std` feature which is on by default. When it is off, we compile as `no_std` and make parts of the API that require `std::io` conditional on the `std` feature.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 114de41..af4dfee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -71,6 +71,13 @@
#![deny(warnings, missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(html_root_url = "https://docs.rs/bytes/0.5.0")]
+#![no_std]
+
+extern crate alloc;
+
+#[cfg(feature = "std")]
+extern crate std;
+
pub mod buf;
pub use crate::buf::{
Buf,