Merge bitcoindevkit/rust-electrum-client#159: ci(msrv): bump MSRV to 1.75 and rustls to 0.23.21

3dc4daceaf ci(clippy): bump to `1.84` (Leonardo Lima)
5a476fdfd9 deps(rustls): bump to `0.23.21` (Leonardo Lima)
ec90685324 ci(msrv): bump rust MSRV to `1.75` (Leonardo Lima)

Pull request description:

  partially fixes https://github.com/bitcoindevkit/bdk/issues/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](3dc4daceaf)
  ValuedMammal:
    ACK 3dc4dac
  notmandatory:
    ACK 3dc4daceaf

Tree-SHA512: 3b9c2feffc8cc32cb9751a36406e7f0d5ed4692afa1af186621bef93da924def3e23c5132e004deef955e40bd7c3242a2d07c33e3843b1b76b613be2f54afefe
This commit is contained in:
Steve Myers 2025-01-23 09:39:47 -06:00
commit 805ea0af30
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051
7 changed files with 16 additions and 26 deletions

View File

@ -12,7 +12,7 @@ jobs:
matrix:
rust:
- stable # STABLE
- 1.63.0 # MSRV
- 1.75.0 # MSRV
steps:
- name: Checkout
uses: actions/checkout@v4
@ -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
@ -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/rust-cache@v2.2.1

View File

@ -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
@ -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 }

View File

@ -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.

View File

@ -1 +1 @@
msrv="1.63.0"
msrv="1.75.0"

View File

@ -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>() {
@ -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>() {

View File

@ -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)
}
@ -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)
}

View File

@ -135,7 +135,7 @@ enum Authentication<'a> {
None,
}
impl<'a> Authentication<'a> {
impl Authentication<'_> {
fn id(&self) -> u8 {
match *self {
Authentication::Password { .. } => 2,
@ -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)
}
@ -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)
}