Skip to content

Commit

Permalink
Update minimum supported Rust version to 1.56.0
Browse files Browse the repository at this point in the history
This change updates the minimum supported version of Rust to 1.56.0.
This version allows us to switch over to Rust edition 2021. A lot of
crates these days require somewhat more recent Rust versions in order to
build successfully and this is a first step towards reducing friction
with version bumps.
  • Loading branch information
d-e-s-o committed Oct 9, 2024
1 parent a7de9b9 commit 849516c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [1.47.0, stable, beta, nightly]
rust: [1.56.1, stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Unreleased
`gpg-connect-agent` unless it is already set
- Fixed endless loop when a Nitrokey FIDO2 device is present
- Added community maintained Nix flake to the repository
- Updated minimum supported Rust version to `1.47.0`
- Bumped `anyhow` dependency to `1.0.68`
- Bumped `directories` dependency to `4.0.1`
- Bumped `libc` dependency to `0.2.125`
- Bumped `serde` dependency to `1.0.136`
- Adjusted program to use Rust Edition 2021
- Updated minimum supported Rust version to `1.56.0`
- Bumped `anyhow` dependency to `1.0.89`
- Bumped `directories` dependency to `5.0.1`
- Bumped `libc` dependency to `0.2.159`
- Bumped `serde` dependency to `1.0.147`
- Bumped `structopt` dependency to `0.3.26`
- Bumped `toml` dependency to `0.5.9`

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[package]
name = "nitrocli"
version = "0.4.1"
edition = "2018"
edition = "2021"
authors = ["Daniel Mueller <[email protected]>"]
license = "GPL-3.0-or-later"
homepage = "https://github.com/d-e-s-o/nitrocli"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![pipeline](https://github.com/d-e-s-o/nitrocli/actions/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/d-e-s-o/nitrocli/commits/main)
[![crates.io](https://img.shields.io/crates/v/nitrocli.svg)](https://crates.io/crates/nitrocli)
[![rustc](https://img.shields.io/badge/rustc-1.47+-blue.svg)](https://blog.rust-lang.org/2020/10/08/Rust-1.47.html)
[![rustc](https://img.shields.io/badge/rustc-1.56+-blue.svg)](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html)

nitrocli
========
Expand Down
5 changes: 2 additions & 3 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// args.rs

// Copyright (C) 2020-2021 The Nitrocli Developers
// Copyright (C) 2020-2024 The Nitrocli Developers
// SPDX-License-Identifier: GPL-3.0-or-later

use std::convert;
use std::ffi;

/// Provides access to a Nitrokey device
Expand Down Expand Up @@ -55,7 +54,7 @@ impl From<DeviceModel> for nitrokey::Model {
}
}

impl convert::TryFrom<nitrokey::Model> for DeviceModel {
impl TryFrom<nitrokey::Model> for DeviceModel {
type Error = anyhow::Error;

fn try_from(model: nitrokey::Model) -> Result<DeviceModel, anyhow::Error> {
Expand Down
5 changes: 2 additions & 3 deletions src/tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later

use std::collections;
use std::convert;
use std::convert::TryFrom as _;
use std::convert::TryInto as _;
use std::fs;
Expand Down Expand Up @@ -220,7 +219,7 @@ fn connect_usb_path_model_serial(_model: nitrokey::Model) -> anyhow::Result<()>
let devices = nitrokey::list_devices()?;
for device in devices {
let model = device.model.map(|nkmodel| {
convert::TryInto::<args::DeviceModel>::try_into(nkmodel).expect("Unexpected Nitrokey model")
TryInto::<args::DeviceModel>::try_into(nkmodel).expect("Unexpected Nitrokey model")
});
let mut args = Vec::new();
args.push("status".to_owned());
Expand Down Expand Up @@ -248,7 +247,7 @@ fn connect_usb_path_model_wrong_serial(_model: nitrokey::Model) -> anyhow::Resul
let devices = nitrokey::list_devices()?;
for device in devices {
let model = device.model.map(|nkmodel| {
convert::TryInto::<args::DeviceModel>::try_into(nkmodel).expect("Unexpected Nitrokey model")
TryInto::<args::DeviceModel>::try_into(nkmodel).expect("Unexpected Nitrokey model")
});
let mut args = Vec::new();
args.push("status".to_owned());
Expand Down

0 comments on commit 849516c

Please sign in to comment.