diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 542179b..0d0b989 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -38,6 +38,12 @@ jobs: command: check args: --all --bins --all-features + - name: Run cargo check without default features + uses: actions-rs/cargo@v1 + with: + command: check + args: --no-default-features + - name: Run cargo check uses: actions-rs/cargo@v1 with: diff --git a/Cargo.toml b/Cargo.toml index fe15c4b..17c25fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polling" -version = "1.0.3" +version = "1.1.0" authors = ["Stjepan Glavina "] edition = "2018" description = "Portable interface to epoll, kqueue, event ports, and wepoll" @@ -12,6 +12,10 @@ keywords = ["mio", "epoll", "kqueue", "iocp", "wepoll"] categories = ["asynchronous", "network-programming", "os"] readme = "README.md" +[features] +default = ["std"] +std = [] + [dependencies] cfg-if = "0.1.10" log = "0.4.11" diff --git a/src/lib.rs b/src/lib.rs index b420307..c126fcd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,6 +46,8 @@ //! # std::io::Result::Ok(()) //! ``` +#![cfg(feature = "std")] +#![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] use std::fmt;