chore: Update to edition 2024

* chore(deps): `cargo update`

* chore: update to Rust edition 2024 and apply fixes

Update the Rust edition and apply changes required in the new edition.
Also update the Cargo manifests to reflect the edition change, and
ensure changes automatically apply to workspace members in the future.

* chore: format all code with `rustfmt`

The new Rust edition comes with some new formatting defaults, which need
to be applied since the edition was increased.

* style: change suggested matches back to `if let`

There has been a breaking change in Rust edition 2024 that changed the
behavior of `if let` statements slightly. The new behavior is more in
line with what users would expect, but could lead to problems in
existing code. The automatic edition update therefore changed such `if
let` statements to match statements instead. That lead to deeply nested
code which was hard to reason about.

This changes most of them back to regular `if let` chains, as the new
behavior shouldn't cause problems for these cases.

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
Thomas Frans
2025-03-11 10:06:39 +01:00
committed by GitHub
parent 7599a39970
commit 9c3c7f7c87
37 changed files with 334 additions and 408 deletions

View File

@@ -3,7 +3,10 @@
[package]
name = "xtask"
version = "0.1.0"
edition = "2021"
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
[dependencies]
clap_mangen = "0.2.26"

View File

@@ -1,9 +1,9 @@
use std::path::PathBuf;
use std::{env, fs};
use clap::ArgMatches;
use clap::builder::PathBufValueParser;
use clap::error::{Error, ErrorKind};
use clap::ArgMatches;
use clap_complete::Shell;
use ncspot::{AUTHOR, BIN_NAME};