Skip to content

Commit

Permalink
Depend on our new io crate
Browse files Browse the repository at this point in the history
Remove the optional dependency on `core2` and add an optional dependency
on the new `bitcoin-io` crate.

Note we never need to enable the "std" or "alloc" features in `io`.
  • Loading branch information
tcharding committed Dec 12, 2023
1 parent 66fe455 commit 615b72a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ alloc = []
[dependencies]
arrayvec = { version = "0.7", default-features = false }

core2 = { version = "0.3.2", default-features = false, optional = true }
io = { package = "bitcoin-io", version = "0.1.0", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }


[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -50,3 +49,6 @@ name = "wrap_array_fmt_traits"
[[example]]
name = "serde"
required-features = ["std", "serde"]

[patch.crates-io.bitcoin-io]
path = "../../rust-bitcoin/master/io"
2 changes: 1 addition & 1 deletion contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

FEATURES="std alloc core2 serde"
FEATURES="std alloc io serde"
MSRV="1\.48\.0"

cargo --version
Expand Down
7 changes: 1 addition & 6 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
use core::iter::FusedIterator;
use core::str;
#[cfg(feature = "std")]
use std::io;

#[cfg(all(feature = "core2", not(feature = "std")))]
use core2::io;

use crate::error::{InvalidCharError, OddLengthStringError};

Expand Down Expand Up @@ -76,7 +71,7 @@ impl<'a> ExactSizeIterator for HexToBytesIter<'a> {

impl<'a> FusedIterator for HexToBytesIter<'a> {}

#[cfg(any(feature = "std", feature = "core2"))]
#[cfg(feature = "io")]
impl<'a> io::Read for HexToBytesIter<'a> {
#[inline]
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
Expand Down

0 comments on commit 615b72a

Please sign in to comment.