From 8b3b419f13e9bc8eeb716d2202adf5c379de0801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Wed, 29 May 2024 22:48:14 +0200 Subject: [PATCH 1/2] Set Rust edition to 2021 No immediate need for the new edition. But no reason to leave it at 2018. Allows more modern Rust code and can be helpful in certain cases --- CHANGELOG.md | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 159e87d..4ad86c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Changed * Upgrade `ipnetwork` dependency from 0.16 to 0.20. This is a breaking change since `ipnetwork` is part of the public API. +* Upgrade crate to Rust 2021 edition. ### Removed * Remove `PoolAddrList::to_palist` from the public API. It should never have been exposed. diff --git a/Cargo.toml b/Cargo.toml index 11b133c..80926d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/mullvad/pfctl-rs" readme = "README.md" keywords = ["pf", "firewall", "macos", "packet", "filter"] categories = ["network-programming", "os", "os::macos-apis", "api-bindings"] -edition = "2018" +edition = "2021" [badges] travis-ci = { repository = "mullvad/pfctl-rs" } From fddc4ca60af0ce4fdbdf27368a991b051d4096ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Wed, 29 May 2024 23:43:25 +0200 Subject: [PATCH 2/2] Add rust-version to package metadata --- .github/workflows/build-and-test.yml | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 28c3b42..ff6b555 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,6 +17,7 @@ jobs: build-and-test: strategy: matrix: + # Keep MSRV in sync with rust-version in Cargo.toml as much as possible. rust: [stable, beta, nightly, 1.62.0] runs-on: macos-latest steps: diff --git a/Cargo.toml b/Cargo.toml index 80926d8..4c2ac34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ readme = "README.md" keywords = ["pf", "firewall", "macos", "packet", "filter"] categories = ["network-programming", "os", "os::macos-apis", "api-bindings"] edition = "2021" +rust-version = "1.62.0" [badges] travis-ci = { repository = "mullvad/pfctl-rs" }