diff --git a/Cargo.toml b/Cargo.toml index a538d4d42..88860af96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,20 +14,18 @@ rust-version = "1.63.0" [features] default = ["std"] std = ["bitcoin/std", "bitcoin/secp-recovery", "bech32/std"] -no-std = ["bech32/alloc"] compiler = [] trace = [] -serde = ["actual-serde", "bitcoin/serde"] +serde = ["dep:serde", "bitcoin/serde"] rand = ["bitcoin/rand"] base64 = ["bitcoin/base64"] [dependencies] -bech32 = { version = "0.11.0", default-features = false } +bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] } bitcoin = { version = "0.32.0", default-features = false } -# Do NOT use this as a feature! Use the `serde` feature instead. -actual-serde = { package = "serde", version = "1.0.103", optional = true } +serde = { version = "1.0.103", optional = true } [dev-dependencies] serde_test = "1.0.147" diff --git a/README.md b/README.md index 6e638ff2a..b471d4ad7 100644 --- a/README.md +++ b/README.md @@ -27,24 +27,17 @@ are convertible to `bitcoin::PublicKey` completing an unsigned `bitcoin::TxIn` with appropriate data * Determining the specific keys, hash preimages and timelocks used to spend coins in a given Bitcoin transaction -* `no_std` support enabled by disabling the `default-features` and enabling -`"no-std"`. See `embedded/` for an example. +* `no_std` support enabled by disabling the `default-features`. See `embedded/` for an example. More information can be found in [the documentation](https://docs.rs/miniscript) or in [the `examples/` directory](https://github.com/rust-bitcoin/rust-miniscript/tree/master/examples) -## Building - -The cargo feature `std` is enabled by default. At least one of the features `std` or `no-std` or both must be enabled. - -Enabling the `no-std` feature does not disable `std`. To disable the `std` feature you must disable default features. The `no-std` feature only enables additional features required for this crate to be usable without `std`. Both can be enabled without conflict. - ## Minimum Supported Rust Version (MSRV) This library should always compile with any combination of features on **Rust 1.63.0**. Some dependencies do not play nicely with our MSRV, if you are running the tests -you may need to pin some dependencies. See `./contrib/test.sh` for current pinning. +you may need to pin some dependencies. See `./contrib/pin.sh` for current pinning. ## Contributing diff --git a/contrib/test_vars.sh b/contrib/test_vars.sh index 337c4e921..2390b8348 100644 --- a/contrib/test_vars.sh +++ b/contrib/test_vars.sh @@ -7,12 +7,8 @@ # Test all these features with "std" enabled. FEATURES_WITH_STD="compiler trace serde rand base64" -# Test all these features with "no-std" enabled. -# rust-miniscript only: https://github.com/rust-bitcoin/rust-miniscript/issues/681 -FEATURES_WITH_NO_STD="compiler trace serde rand base64" - # Test all these features without "std" enabled. -FEATURES_WITHOUT_STD="" +FEATURES_WITHOUT_STD="compiler trace serde rand base64" # Run these examples. # Note `examples/big` should not be run. diff --git a/embedded/Cargo.toml b/embedded/Cargo.toml index 744c51733..15ac8ac4f 100644 --- a/embedded/Cargo.toml +++ b/embedded/Cargo.toml @@ -15,7 +15,7 @@ cortex-m-rt = "0.6.10" cortex-m-semihosting = "0.3.3" panic-halt = "0.2.0" alloc-cortex-m = "0.4.1" -miniscript = { path = "../", default-features = false, features = ["no-std"] } +miniscript = { path = "../", default-features = false } [[bin]] name = "embedded" diff --git a/src/lib.rs b/src/lib.rs index 63885ab75..3cd25d9eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,9 +89,6 @@ compile_error!( "rust-miniscript currently only supports architectures with pointers wider than 16 bits" ); -#[cfg(not(any(feature = "std", feature = "no-std")))] -compile_error!("at least one of the `std` or `no-std` features must be enabled"); - pub use bitcoin; #[cfg(not(feature = "std"))] @@ -102,7 +99,7 @@ extern crate alloc; extern crate core; #[cfg(feature = "serde")] -pub use actual_serde as serde; +pub use serde; #[cfg(bench)] extern crate test;