From 357d7be8652d8bf2fe2a630cd7d50a4f0d87e49e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sun, 3 Nov 2024 01:41:13 +0000 Subject: [PATCH] Bump MSRV to 1.60, migrate to Rust 2021 --- CHANGELOG.md | 4 ++++ Cargo.toml | 3 ++- rust-toolchain.toml | 2 +- src/assuan.rs | 4 ++-- src/lib.rs | 8 ++++---- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eac2ff0..b275238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to Rust's notion of [Semantic Versioning](https://semver.org/spec/v2.0.0.html). All versions prior to 1.0.0 are beta releases. +## Unreleased +- MSRV has been increased to 1.56.0 +- Bumped `secrecy` crate to 0.10 + ## [0.5.1] - 2024-08-31 ### Fixed - Client requests are now correctly percent-encoded when necessary. diff --git a/Cargo.toml b/Cargo.toml index c628297..f23079d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,8 @@ readme = "README.md" keywords = ["passphrase", "password"] categories = ["api-bindings", "command-line-interface"] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.60" [dependencies] log = "0.4" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a0d7144..47fd09e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.51.0" +channel = "1.60.0" components = ["clippy", "rustfmt"] diff --git a/src/assuan.rs b/src/assuan.rs index 10fe6a0..1bbba01 100644 --- a/src/assuan.rs +++ b/src/assuan.rs @@ -184,8 +184,8 @@ mod read { use super::Response; fn gpg_error_code(input: &str) -> IResult<&str, u16> { - map(digit1, |code| { - let full = u32::from_str_radix(code, 10).expect("have decimal digits"); + map(digit1, |code: &str| { + let full = code.parse::().expect("have decimal digits"); // gpg uses the lowest 16 bits for error codes. full as u16 })(input) diff --git a/src/lib.rs b/src/lib.rs index 6e2e620..0d24c27 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,7 @@ //! ``` // Catch documentation errors caused by code changes. -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![deny(missing_docs)] use secrecy::SecretString; @@ -84,7 +84,7 @@ impl<'a> PassphraseInput<'a> { /// /// Returns `None` if `pinentry` cannot be found in `PATH`. pub fn with_default_binary() -> Option { - Self::with_binary("pinentry".to_owned()) + Self::with_binary("pinentry") } /// Creates a new PassphraseInput using the given path to, or name of, a `pinentry` @@ -265,7 +265,7 @@ impl<'a> ConfirmationDialog<'a> { /// /// Returns `None` if `pinentry` cannot be found in `PATH`. pub fn with_default_binary() -> Option { - Self::with_binary("pinentry".to_owned()) + Self::with_binary("pinentry") } /// Creates a new ConfirmationDialog using the given path to, or name of, a `pinentry` @@ -390,7 +390,7 @@ impl<'a> MessageDialog<'a> { /// /// Returns `None` if `pinentry` cannot be found in `PATH`. pub fn with_default_binary() -> Option { - Self::with_binary("pinentry".to_owned()) + Self::with_binary("pinentry") } /// Creates a new MessageDialog using the given path to, or name of, a `pinentry`