Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(msrv): bump MSRV to 1.75 and rustls to 0.23.21 #159

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading