Skip to content

Commit

Permalink
Remove no-std and actual-serde features
Browse files Browse the repository at this point in the history
The `no-std` feature is no longer needed with `bitcoin` version 0.32.0

- Update README.md, including updating to the `./contrib/pin.sh` path
- Disable `actual-serde` implicit feature
  • Loading branch information
JoseSK999 committed Nov 11, 2024
1 parent acbd120 commit 8372e8c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions contrib/test_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion embedded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand All @@ -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;
Expand Down

0 comments on commit 8372e8c

Please sign in to comment.