From 6d035c57a8debd47cb8ff83a132798a5b747e011 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 2 Mar 2026 12:58:42 -0600 Subject: [PATCH] chore: Migrate to Edition 2024 --- Cargo.toml | 2 +- src/in-depth/machine-communication-stdin.rs | 2 +- src/in-depth/signals-channels.rs | 4 ++-- src/tutorial/errors-exit.rs | 4 ++-- src/tutorial/impl-draft-shortcut.rs | 6 ++---- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c7ca4e5..9561f8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "CLAiR" version = "0.1.0" authors = ["Pascal Hertleif "] -edition = "2018" +edition = "2024" [[bin]] name = "cli-args-vars" diff --git a/src/in-depth/machine-communication-stdin.rs b/src/in-depth/machine-communication-stdin.rs index 5842778..c615bca 100644 --- a/src/in-depth/machine-communication-stdin.rs +++ b/src/in-depth/machine-communication-stdin.rs @@ -1,7 +1,7 @@ use clap::{CommandFactory, Parser}; use std::{ fs::File, - io::{stdin, BufRead, BufReader, IsTerminal}, + io::{BufRead, BufReader, IsTerminal, stdin}, path::PathBuf, }; diff --git a/src/in-depth/signals-channels.rs b/src/in-depth/signals-channels.rs index 3824141..191d0ef 100644 --- a/src/in-depth/signals-channels.rs +++ b/src/in-depth/signals-channels.rs @@ -1,6 +1,6 @@ -use std::time::Duration; -use crossbeam_channel::{bounded, tick, Receiver, select}; use anyhow::Result; +use crossbeam_channel::{Receiver, bounded, select, tick}; +use std::time::Duration; fn ctrl_channel() -> Result, ctrlc::Error> { let (sender, receiver) = bounded(100); diff --git a/src/tutorial/errors-exit.rs b/src/tutorial/errors-exit.rs index c0046f8..6100bc0 100644 --- a/src/tutorial/errors-exit.rs +++ b/src/tutorial/errors-exit.rs @@ -2,8 +2,8 @@ use anyhow::{Context, Result}; fn main() -> Result<()> { let path = "test.txt"; - let content = std::fs::read_to_string(path) - .with_context(|| format!("could not read file `{}`", path))?; + let content = + std::fs::read_to_string(path).with_context(|| format!("could not read file `{}`", path))?; println!("file content: {}", content); Ok(()) } diff --git a/src/tutorial/impl-draft-shortcut.rs b/src/tutorial/impl-draft-shortcut.rs index 5bbf4f6..d258098 100644 --- a/src/tutorial/impl-draft-shortcut.rs +++ b/src/tutorial/impl-draft-shortcut.rs @@ -1,8 +1,6 @@ #![allow(unused)] fn main() { - -let path = "test.txt"; -let pattern = "foo"; - + let path = "test.txt"; + let pattern = "foo"; }