Skip to content

Commit

Permalink
Merge #159: ci(msrv): bump MSRV to 1.75 and rustls to 0.23.21
Browse files Browse the repository at this point in the history
3dc4dac ci(clippy): bump to `1.84` (Leonardo Lima)
5a476fd deps(rustls): bump to `0.23.21` (Leonardo Lima)
ec90685 ci(msrv): bump rust MSRV to `1.75` (Leonardo Lima)

Pull request description:

  partially fixes bitcoindevkit/bdk#1750

  It bumps the project MSRV to `1.75.0` in order to follow along with LDK changes, and to remove the pinned version of `rustls`, which now is under `1.71` MSRV, bumping it to latest `0.23.21`.

  It also updates the `clippy` step on CI to use rust `1.84`, fixing the found clippy issues.

ACKs for top commit:
  tnull:
    > ACK [3dc4dac](3dc4dac)
  ValuedMammal:
    ACK 3dc4dac
  notmandatory:
    ACK 3dc4dac

Tree-SHA512: 3b9c2feffc8cc32cb9751a36406e7f0d5ed4692afa1af186621bef93da924def3e23c5132e004deef955e40bd7c3242a2d07c33e3843b1b76b613be2f54afefe
  • Loading branch information
notmandatory committed Jan 23, 2025
2 parents 15f753f + 3dc4dac commit 805ea0a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 26 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
rust:
- stable # STABLE
- 1.63.0 # MSRV
- 1.75.0 # MSRV
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,10 +28,6 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Pin dependencies for MSRV
if: matrix.rust == '1.63.0'
run: |
cargo update -p rustls --precise "0.23.19"
- name: Test
run: cargo test --verbose --all-features
- name: Setup iptables for the timeout test
Expand Down Expand Up @@ -61,12 +57,13 @@ jobs:
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check

clippy_check:
name: Rust clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.78.0
toolchain: 1.84.0
components: clippy
- name: Rust Cache
uses: Swatinem/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ documentation = "https://docs.rs/electrum-client/"
description = "Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers."
keywords = ["bitcoin", "electrum"]
readme = "README.md"
rust-version = "1.63.0"
rust-version = "1.75.0"
edition = "2021"

# loosely based on https://github.com/evgeniy-scherbina/rust-electrumx-client
Expand All @@ -26,7 +26,7 @@ serde_json = { version = "^1.0" }

# Optional dependencies
openssl = { version = "0.10", optional = true }
rustls = { version = "0.23.19", optional = true, default-features = false }
rustls = { version = "0.23.21", optional = true, default-features = false }
webpki-roots = { version = "0.25", optional = true }

byteorder = { version = "1.0", optional = true }
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
[GitHub Workflow]: https://github.com/bitcoindevkit/rust-electrum-client/actions?query=workflow%3ACI
[Latest Version]: https://img.shields.io/crates/v/electrum-client.svg
[crates.io]: https://crates.io/crates/electrum-client
[MSRV Badge]: https://img.shields.io/badge/rustc-1.63.0%2B-lightgrey.svg
[Rust Blog]: https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html
[MSRV Badge]: https://img.shields.io/badge/rustc-1.75.0%2B-lightgrey.svg
[Rust Blog]: https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.

## Minimum Supported Rust Version (MSRV)

This library should compile with any combination of features with Rust 1.63.0.

To build with the MSRV you will need to pin dependencies as follows:

```shell
cargo update -p rustls --precise "0.23.19"
```

This library should compile with any combination of features with Rust 1.75.0.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv="1.63.0"
msrv="1.75.0"
4 changes: 2 additions & 2 deletions src/socks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl ToTargetAddr for (Ipv6Addr, u16) {
}
}

impl<'a> ToTargetAddr for (&'a str, u16) {
impl ToTargetAddr for (&str, u16) {
fn to_target_addr(&self) -> io::Result<TargetAddr> {
// try to parse as an IP first
if let Ok(addr) = self.0.parse::<Ipv4Addr>() {
Expand All @@ -114,7 +114,7 @@ impl<'a> ToTargetAddr for (&'a str, u16) {
}
}

impl<'a> ToTargetAddr for &'a str {
impl ToTargetAddr for &str {
fn to_target_addr(&self) -> io::Result<TargetAddr> {
// try to parse as an IP first
if let Ok(addr) = self.parse::<SocketAddrV4>() {
Expand Down
4 changes: 2 additions & 2 deletions src/socks/v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Read for Socks4Stream {
}
}

impl<'a> Read for &'a Socks4Stream {
impl Read for &Socks4Stream {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(&self.socket).read(buf)
}
Expand All @@ -164,7 +164,7 @@ impl Write for Socks4Stream {
}
}

impl<'a> Write for &'a Socks4Stream {
impl Write for &Socks4Stream {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&self.socket).write(buf)
}
Expand Down
6 changes: 3 additions & 3 deletions src/socks/v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ enum Authentication<'a> {
None,
}

impl<'a> Authentication<'a> {
impl Authentication<'_> {
fn id(&self) -> u8 {
match *self {
Authentication::Password { .. } => 2,
Expand Down Expand Up @@ -329,7 +329,7 @@ impl Read for Socks5Stream {
}
}

impl<'a> Read for &'a Socks5Stream {
impl Read for &Socks5Stream {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(&self.socket).read(buf)
}
Expand All @@ -345,7 +345,7 @@ impl Write for Socks5Stream {
}
}

impl<'a> Write for &'a Socks5Stream {
impl Write for &Socks5Stream {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&self.socket).write(buf)
}
Expand Down

0 comments on commit 805ea0a

Please sign in to comment.