From 8fd5fcdb60515e626947091fc044f06d39c85cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20K=C3=B6nig?= Date: Sun, 3 May 2026 19:12:44 +0200 Subject: [PATCH] refactor: upgrade Rust edition to 2024 --- Cargo.toml | 2 +- src/config.rs | 2 +- src/main.rs | 12 ++++++------ src/repo.rs | 2 +- src/scp.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e2f6d86..5069909 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT" description = "A tool that reminds you to commit with the correct email address" repository = "https://github.com/mkqavi/commit-email" readme = "README.md" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/config.rs b/src/config.rs index 80c5718..88b61b6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -22,7 +22,7 @@ impl Config { return Err(anyhow::Error::from(io::Error::new( io::ErrorKind::NotFound, "Could not find the config directory", - ))) + ))); } }; diff --git a/src/main.rs b/src/main.rs index 0d1e490..ab2f742 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,8 @@ -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use config::Config; +use cursive::Cursive; use cursive::event::Key; use cursive::views::{Dialog, SelectView}; -use cursive::Cursive; use repo::Repo; use scp::ScpPath; use std::env; @@ -31,10 +31,10 @@ fn main() -> Result<()> { let config_url = repo.get_remote_url(); - if let Some(url) = &config_url { - if config.ignores(url) { - return Ok(()); - } + if let Some(url) = &config_url + && config.ignores(url) + { + return Ok(()); } if repo.get_local_email().is_some() { diff --git a/src/repo.rs b/src/repo.rs index 4c1acec..e4374d3 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -1,4 +1,4 @@ -use crate::{repo_error::RepoError, ScpPath}; +use crate::{ScpPath, repo_error::RepoError}; use git2::{Config, ConfigLevel, Repository}; use std::{ path::Path, diff --git a/src/scp.rs b/src/scp.rs index 595befd..f7fe70f 100644 --- a/src/scp.rs +++ b/src/scp.rs @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use regex::Regex; use serde::{Deserialize, Serialize}; use std::str::FromStr;