Skip to content

Commit 6bd5418

Browse files
committed
Set minimum supported rust version to 1.77
CI test case included also. Signed-off-by: Gris Ge <[email protected]>
1 parent a473cca commit 6bd5418

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

.github/workflows/msrv.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Minium Support Rust Version Test
2+
3+
concurrency:
4+
group: msrv-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
push:
11+
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
12+
13+
jobs:
14+
build_on_msrv:
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
include:
19+
- msrv: "1.77"
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v5
25+
26+
- name: Install Rust ${{ matrix.msrv }}
27+
run: rustup install ${{ matrix.msrv }}
28+
29+
- name: Build test
30+
run: cargo +${{ matrix.msrv }} build --ignore-rust-version

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["Corentin Henry <[email protected]>"]
33
name = "netlink-packet-route"
44
version = "0.25.0"
55
edition = "2021"
6-
6+
rust-version = "1.77"
77
homepage = "https://github.com/rust-netlink/netlink-packet-route"
88
keywords = ["netlink", "linux"]
99
license = "MIT"

src/route/lwtunnel.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
use std::{fmt::Debug, net::Ipv6Addr};
3+
use std::{fmt::Debug, mem::size_of, net::Ipv6Addr};
44

55
use netlink_packet_core::{
66
emit_u16_be, emit_u64_be, parse_u16_be, parse_u64_be, parse_u8,
@@ -179,13 +179,13 @@ impl Nla for RouteIp6Tunnel {
179179
fn value_len(&self) -> usize {
180180
match self {
181181
Self::Unspecified => 0,
182-
Self::Id(_) => const { size_of::<u64>() },
183-
Self::Destination(_) => const { size_of::<Ipv6Addr>() },
184-
Self::Source(_) => const { size_of::<Ipv6Addr>() },
185-
Self::Hoplimit(_) => const { size_of::<u8>() },
186-
Self::Tc(_) => const { size_of::<u8>() },
187-
Self::Flags(_) => const { size_of::<u16>() },
188-
Self::Other(_) => const { size_of::<DefaultNla>() },
182+
Self::Id(_) => size_of::<u64>(),
183+
Self::Destination(_) => size_of::<Ipv6Addr>(),
184+
Self::Source(_) => size_of::<Ipv6Addr>(),
185+
Self::Hoplimit(_) => size_of::<u8>(),
186+
Self::Tc(_) => size_of::<u8>(),
187+
Self::Flags(_) => size_of::<u16>(),
188+
Self::Other(_) => size_of::<DefaultNla>(),
189189
}
190190
}
191191

0 commit comments

Comments
 (0)