Skip to content

Commit fccfc45

Browse files
authored
[1/n] [ci] update MSRV and test on it, add clippy, fix clippy warnings (#70)
Clippy flagged an outdated MSRV -- update to the version currently in Omicron, and add CI for the various permutations. Also allow `/target` to be a symlink -- this is the setup I use.
1 parent 13afd8c commit fccfc45

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

.github/workflows/rust.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
#
44
name: Rust
55

6+
env:
7+
RUSTFLAGS: -D warnings
8+
69
on:
710
push:
811
branches: [ main ]
912
pull_request:
10-
branches: [ main ]
13+
# Allow CI to run on all PRs, not just ones targeting main. This allows
14+
# stacked PRs to be tested.
1115

1216
jobs:
1317
check-style:
@@ -22,15 +26,22 @@ jobs:
2226
components: rustfmt
2327
- name: Check style
2428
run: cargo fmt -- --check
29+
- name: Check clippy
30+
run: cargo clippy --all-targets --all-features
2531

2632
build-and-test:
2733
runs-on: ${{ matrix.os }}
2834
strategy:
2935
matrix:
36+
# 1.81 is the MSRV.
37+
toolchain: [ stable, "1.81" ]
3038
os: [ ubuntu-latest, macos-latest ]
3139
steps:
3240
# actions/checkout@v2
3341
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
42+
- uses: dtolnay/rust-toolchain@v1
43+
with:
44+
toolchain: ${{ matrix.toolchain }}
3445
- name: Build
3546
run: cargo build --tests --verbose
3647
- name: Run tests

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generated by Cargo
22
# will have compiled files and executables
3-
/target/
3+
/target
44

55
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
66
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ name = "omicron-zone-package"
33
version = "0.11.1"
44
authors = ["Sean Klein <[email protected]>"]
55
edition = "2021"
6-
#
7-
# Report a specific error in the case that the toolchain is too old for
8-
# let-else:
9-
#
10-
rust-version = "1.65.0"
6+
rust-version = "1.81.0"
117
license = "MPL-2.0"
128
repository = "https://github.com/oxidecomputer/omicron-package"
139
description = "Packaging tools for Oxide's control plane software"

src/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ impl Config {
113113
self.packages
114114
.iter()
115115
.filter(|(_, pkg)| target.includes_package(pkg))
116-
.map(|(name, pkg)| (name, pkg))
117116
.collect(),
118117
)
119118
}

src/package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub struct BuildConfig<'a> {
215215
static DEFAULT_TARGET: Target = Target(BTreeMap::new());
216216
static DEFAULT_PROGRESS: NoProgress = NoProgress::new();
217217

218-
impl<'a> Default for BuildConfig<'a> {
218+
impl Default for BuildConfig<'_> {
219219
fn default() -> Self {
220220
Self {
221221
target: &DEFAULT_TARGET,

0 commit comments

Comments
 (0)