Skip to content

Commit af5933a

Browse files
committed
Set minimal supported Rust version to 1.75
Current code has `Option::is_none_or()` which released 2024 Oct 17, considering old compiler environment like Ubuntu 24.04 LTS, RHEL 9, replaced it to: ```rust self.unsolicited_messages_tx.as_ref().is_none() || self.unsolicited_messages_tx.as_ref().map(|x| x.is_closed()) ``` Set minimum supported Rust version to 1.75 to `Cargo.toml` and enabled CI test for it. Signed-off-by: Gris Ge <[email protected]>
1 parent 8811b0d commit af5933a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ authors = ["Corentin Henry <[email protected]>"]
33
name = "netlink-proto"
44
version = "0.11.4"
55
edition = "2018"
6+
rust-version = "1.75"
67

78
homepage = "https://github.com/rust-netlink/netlink-proto"
89
keywords = ["netlink", "linux", "async"]

src/connection.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,13 @@ where
236236
}
237237
}
238238

239+
// Rust 1.82 has Option::is_none_or() which can simplify
240+
// below checks but that version is released on 2024 Oct. 17 which
241+
// is not available on old OS like Ubuntu 24.04 LTS, RHEL 9 yet.
239242
if ready
240-
|| self
241-
.unsolicited_messages_tx
242-
.as_ref()
243-
.is_none_or(|x| x.is_closed())
243+
|| self.unsolicited_messages_tx.as_ref().is_none()
244+
|| self.unsolicited_messages_tx.as_ref().map(|x| x.is_closed())
245+
== Some(true)
244246
{
245247
// The channel is closed so we can drop the sender.
246248
let _ = self.unsolicited_messages_tx.take();

0 commit comments

Comments
 (0)