Skip to content

Commit

Permalink
Bump MSRV and fix clippy lints
Browse files Browse the repository at this point in the history
Bumping MSRV to 1.60.0 as required for the picky-asn1 crate.

Also setting the MSRV for clippy and fixing some of the remaining
warnings. Some of the things clippy complains about for newer versions
of the compiler can be fixed/changed without losing support for older
compiler versions, but some features are incompatible. Since clippy is
now configured to understand the MSRV, there's also no need for some of
the `allow` attributes.

Signed-off-by: Ionut Mihalcea <[email protected]>
  • Loading branch information
ionut-arm committed Sep 13, 2023
1 parent e44eced commit 327cc8d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.60.0"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.57.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.60.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
# All in one job as I think it is a big overhead to build and run the Docker
# container?
tests-ubuntu:
Expand Down
1 change: 0 additions & 1 deletion tss-esapi-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn main() {
}
}

#[allow(clippy::uninlined_format_args)]
#[cfg(feature = "generate-bindings")]
pub fn generate_from_system(esapi_out: PathBuf) {
pkg_config::Config::new()
Expand Down
4 changes: 2 additions & 2 deletions tss-esapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ regex = "1.3.9"
zeroize = { version = "1.1.0", features = ["zeroize_derive"] }
tss-esapi-sys = { path = "../tss-esapi-sys", version = "0.4.0" }
oid = "0.2.1"
picky-asn1 = "0.7.2"
picky-asn1-x509 = "0.11.0"
picky-asn1 = "0.5.0"
picky-asn1-x509 = "0.7.1"

[dev-dependencies]
env_logger = "0.9.0"
Expand Down
1 change: 0 additions & 1 deletion tss-esapi/src/tcti_ldr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ impl TctiNameConf {
}
}

#[allow(clippy::uninlined_format_args)]
impl TryFrom<TctiNameConf> for CString {
type Error = Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn test_pcr_read_all() {
)
.expect("Call 3 to pcr_read failed");

vec![read_pcrs_1, read_pcrs_2, read_pcrs_3]
[read_pcrs_1, read_pcrs_2, read_pcrs_3]
.iter()
.enumerate()
.for_each(|(idx, dl)| {
Expand Down
1 change: 0 additions & 1 deletion tss-esapi/tests/integration_tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
#![allow(clippy::uninlined_format_args)]
#[path = "common/mod.rs"]
mod common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::convert::{TryFrom, TryInto};

#[test]
fn test_conversions() {
let expected_algorithm_properties = vec![
let expected_algorithm_properties = [
(AlgorithmIdentifier::Rsa, AlgorithmAttributes(1)),
(AlgorithmIdentifier::Aes, AlgorithmAttributes(2)),
];
Expand Down Expand Up @@ -61,7 +61,7 @@ fn test_conversions() {

#[test]
fn test_valid_conversion_vector() {
let expected_algorithm_properties = vec![
let expected_algorithm_properties = [
(AlgorithmIdentifier::Rsa, AlgorithmAttributes(1)),
(AlgorithmIdentifier::Aes, AlgorithmAttributes(2)),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::convert::{TryFrom, TryInto};

#[test]
fn test_conversions() {
let expected_command_codes = vec![
let expected_command_codes = [
CommandCode::ChangeEps,
CommandCode::ChangePps,
CommandCode::Clear,
Expand Down Expand Up @@ -83,7 +83,7 @@ fn test_conversions() {

#[test]
fn test_valid_conversion_vector() {
let expected_command_codes = vec![
let expected_command_codes = [
CommandCode::ChangeEps,
CommandCode::ChangePps,
CommandCode::Clear,
Expand Down

0 comments on commit 327cc8d

Please sign in to comment.