Skip to content

Commit

Permalink
Invert feature flag from no_std to std
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholastmosher committed Aug 15, 2019
1 parent d9b2e41 commit 8408ed4
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions capnp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ path = "src/lib.rs"

[dependencies]
quickcheck = { version = "0.2", optional = true }
core_io = { version = "0.1.20190701", features = [ "alloc", "collections" ], optional = true }
core_io = { version = "0.1.20190701", features = [ "alloc", "collections" ] }

[dev-dependencies]
quickcheck = "0.2"

[features]
no_std = ["core_io"]
std = []
rpc = ["futures"]
rpc_try = []
default = []
default = ["std"]

[dependencies.futures]
version = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion capnp/src/any_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

//! Dynamically typed value.
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;

use crate::capability::FromClientHook;
Expand Down
2 changes: 1 addition & 1 deletion capnp/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//!
//! Roughly corresponds to capability.h in the C++ implementation.
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;
use core::marker::PhantomData;

Expand Down
2 changes: 1 addition & 1 deletion capnp/src/capability_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

//! List of capabilities.
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;
use core::{self, marker::PhantomData};

Expand Down
24 changes: 12 additions & 12 deletions capnp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@
//! [capnpc-rust](https://github.com/capnproto/capnproto-rust/capnpc) crate.
#![cfg_attr(feature = "rpc_try", feature(try_trait))]

#![cfg_attr(feature = "no_std", no_std)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(any(feature="quickcheck", test))]
extern crate quickcheck;

#[cfg(feature = "rpc")]
extern crate futures;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
extern crate core_io;

#[cfg(not(feature = "no_std"))]
#[cfg(feature = "std")]
use std as core;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use core_io as io;
#[cfg(not(feature = "no_std"))]
#[cfg(feature = "std")]
use std::io as io;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use alloc::string as string;
#[cfg(not(feature = "no_std"))]
#[cfg(feature = "std")]
use std::string as string;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use alloc::str as str;
#[cfg(not(feature = "no_std"))]
#[cfg(feature = "std")]
use std::str as str;

/// Constructs a [`Word`](struct.Word.html) from its constituent bytes, accounting
Expand Down Expand Up @@ -112,9 +112,9 @@ pub mod text;
pub mod text_list;
pub mod traits;

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use alloc::string::String;
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use io::prelude::*;

/// Eight bytes of memory with opaque interior. Use [`capnp_word!()`](macro.capnp_word!.html)
Expand Down
2 changes: 1 addition & 1 deletion capnp/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

//! Untyped root container for a Cap'n Proto value.
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;
use core::{self, convert::From};

Expand Down
2 changes: 1 addition & 1 deletion capnp/src/private/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;

use core::cell::{Cell, RefCell};
Expand Down
2 changes: 1 addition & 1 deletion capnp/src/private/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;
use core;

Expand Down
4 changes: 2 additions & 2 deletions capnp/src/private/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;

use core::{self, mem, ptr, cell::Cell};
Expand Down Expand Up @@ -311,7 +311,7 @@ impl WirePointer {
}

mod wire_helpers {
#[cfg(feature = "no_std")]
#[cfg(not(feature = "std"))]
use crate::io::prelude::*;

use core::{self, mem, ptr, slice};
Expand Down
2 changes: 1 addition & 1 deletion capnpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ name = "capnpc-rust"
path = "src/capnpc-rust.rs"

[dependencies]
capnp = { version = "0.10", path = "../capnp", default-features = false }
capnp = { version = "0.10", path = "../capnp" }

0 comments on commit 8408ed4

Please sign in to comment.