Skip to content

Commit c4fc6db

Browse files
committed
Fix clippy warnings
Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
1 parent 2dd2308 commit c4fc6db

File tree

8 files changed

+107
-107
lines changed

8 files changed

+107
-107
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
- name: Run the tests
8989
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --security-opt seccomp=unconfined fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh
9090

91+
# SEE #558 : remove use of 1.82 once 1.84 rolls out;
9192
tests-valgrind:
9293
name: Valgrind test run
9394
runs-on: ubuntu-latest
@@ -96,7 +97,7 @@ jobs:
9697
- name: Build the container
9798
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
9899
- name: Run the tests
99-
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
100+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUST_TOOLCHAIN_VERSION="1.82" ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
100101

101102
# Check that the documentation builds as well.
102103
docs:

tss-esapi/src/constants/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2020 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
/// This module contains both the constants defined in the TSS specification (tss module)
5-
/// but also the internal representation of the TSS constants.
4+
//! This module contains both the constants defined in the TSS specification (tss module)
5+
//! but also the internal representation of the TSS constants.
66
77
/// Representation of the constants defined in the
88
/// Constants -> TPM_ALG_ID section of the specification

tss-esapi/src/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where
3838
/// The owned bytes in the form of a `Vec<u8>` object.
3939
pub fn to_owned_bytes(ffi_bytes_ptr: *mut u8, size: usize) -> Vec<u8> {
4040
let ffi_bytes = unsafe { Malloced::<[u8]>::slice_from_raw_parts(ffi_bytes_ptr, size) };
41-
return Vec::<u8>::from(ffi_bytes.as_ref());
41+
Vec::<u8>::from(ffi_bytes.as_ref())
4242
}
4343

4444
/// Type used for handling `size_t` variables

tss-esapi/src/handles/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
/// Module that contains the different types of handles
55
/// that the ESAPI and the TPM uses in order to provide
66
/// access to objects that was or has been created.
7-
8-
/////////////////////////////////////////////////////////
9-
/// ESYS Handles
10-
/////////////////////////////////////////////////////////
7+
// ///////////////////////////////////////////////////////
8+
// ESYS Handles
9+
// //////////////////////////////////////////////////////
1110
pub use handle::auth::AuthHandle;
1211
pub use handle::key::KeyHandle;
1312
pub use handle::nv_index::NvIndexHandle;

tss-esapi/src/interface_types/reserved_handles.rs

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ use crate::{
88
Error, Result, WrapperErrorKind,
99
};
1010
use std::convert::TryFrom;
11-
//////////////////////////////////////////////////////////////////////////////////
1211
/// Hierarchy
1312
///
1413
/// Enum describing the object hierarchies in a TPM 2.0.
15-
//////////////////////////////////////////////////////////////////////////////////
1614
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
1715
pub enum Hierarchy {
1816
Owner,
@@ -74,9 +72,9 @@ impl TryFrom<TpmHandle> for Hierarchy {
7472
}
7573
}
7674

77-
//////////////////////////////////////////////////////////////////////////////////
78-
/// Enables
79-
//////////////////////////////////////////////////////////////////////////////////
75+
// ////////////////////////////////////////////////////////////////////////////////
76+
// Enables
77+
// ////////////////////////////////////////////////////////////////////////////////
8078
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8179
pub enum Enables {
8280
Owner,
@@ -143,9 +141,9 @@ impl TryFrom<TpmHandle> for Enables {
143141
}
144142
}
145143

146-
//////////////////////////////////////////////////////////////////////////////////
147-
/// HierarchyAuth
148-
//////////////////////////////////////////////////////////////////////////////////
144+
// ////////////////////////////////////////////////////////////////////////////////
145+
// HierarchyAuth
146+
// ////////////////////////////////////////////////////////////////////////////////
149147
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
150148
pub enum HierarchyAuth {
151149
Owner,
@@ -206,13 +204,13 @@ impl TryFrom<TpmHandle> for HierarchyAuth {
206204
}
207205
}
208206
}
209-
//////////////////////////////////////////////////////////////////////////////////
210-
/// TODO: HierarchyPolicy
211-
//////////////////////////////////////////////////////////////////////////////////
207+
// ///////////////////////////////////////////////////////////////////////////////
208+
// TODO: HierarchyPolicy
209+
// ///////////////////////////////////////////////////////////////////////////////
212210

213-
//////////////////////////////////////////////////////////////////////////////////
214-
/// Platform
215-
//////////////////////////////////////////////////////////////////////////////////
211+
// ////////////////////////////////////////////////////////////////////////////////
212+
// Platform
213+
// ////////////////////////////////////////////////////////////////////////////////
216214
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
217215
pub enum Platform {
218216
Platform,
@@ -234,9 +232,9 @@ impl TryFrom<AuthHandle> for Platform {
234232
}
235233
}
236234
}
237-
//////////////////////////////////////////////////////////////////////////////////
238-
/// Owner
239-
//////////////////////////////////////////////////////////////////////////////////
235+
// ////////////////////////////////////////////////////////////////////////////////
236+
// Owner
237+
// ////////////////////////////////////////////////////////////////////////////////
240238
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
241239
pub enum Owner {
242240
Owner,
@@ -263,9 +261,9 @@ impl TryFrom<ObjectHandle> for Owner {
263261
}
264262
}
265263
}
266-
//////////////////////////////////////////////////////////////////////////////////
267-
/// Endorsement
268-
//////////////////////////////////////////////////////////////////////////////////
264+
// ////////////////////////////////////////////////////////////////////////////////
265+
// Endorsement
266+
// ////////////////////////////////////////////////////////////////////////////////
269267
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
270268
pub enum Endorsement {
271269
Endorsement,
@@ -292,9 +290,9 @@ impl TryFrom<ObjectHandle> for Endorsement {
292290
}
293291
}
294292
}
295-
//////////////////////////////////////////////////////////////////////////////////
296-
/// Provision
297-
//////////////////////////////////////////////////////////////////////////////////
293+
// ////////////////////////////////////////////////////////////////////////////////
294+
// Provision
295+
// ////////////////////////////////////////////////////////////////////////////////
298296
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
299297
pub enum Provision {
300298
Owner,
@@ -321,9 +319,9 @@ impl TryFrom<AuthHandle> for Provision {
321319
}
322320
}
323321
}
324-
//////////////////////////////////////////////////////////////////////////////////
325-
/// Clear
326-
//////////////////////////////////////////////////////////////////////////////////
322+
// ////////////////////////////////////////////////////////////////////////////////
323+
// Clear
324+
// ////////////////////////////////////////////////////////////////////////////////
327325
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
328326
pub enum Clear {
329327
Owner,
@@ -350,9 +348,9 @@ impl TryFrom<AuthHandle> for Clear {
350348
}
351349
}
352350
}
353-
//////////////////////////////////////////////////////////////////////////////////
354-
/// NvAuth
355-
//////////////////////////////////////////////////////////////////////////////////
351+
// ////////////////////////////////////////////////////////////////////////////////
352+
// NvAuth
353+
// ////////////////////////////////////////////////////////////////////////////////
356354
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
357355
pub enum NvAuth {
358356
Platform,
@@ -381,9 +379,9 @@ impl TryFrom<AuthHandle> for NvAuth {
381379
}
382380
}
383381
}
384-
//////////////////////////////////////////////////////////////////////////////////
385-
/// Lockout
386-
//////////////////////////////////////////////////////////////////////////////////
382+
// ////////////////////////////////////////////////////////////////////////////////
383+
// Lockout
384+
// ////////////////////////////////////////////////////////////////////////////////
387385
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
388386
pub enum Lockout {
389387
Lockout,
@@ -406,9 +404,9 @@ impl TryFrom<ObjectHandle> for Lockout {
406404
}
407405
}
408406

409-
//////////////////////////////////////////////////////////////////////////////////
410-
/// NvIndex
411-
//////////////////////////////////////////////////////////////////////////////////
407+
// ////////////////////////////////////////////////////////////////////////////////
408+
// NvIndex
409+
// ////////////////////////////////////////////////////////////////////////////////
412410
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
413411
pub enum NvIndex {
414412
NvIndex(NvIndexTpmHandle),
@@ -428,9 +426,9 @@ impl From<NvIndex> for NvIndexTpmHandle {
428426
}
429427
}
430428

431-
//////////////////////////////////////////////////////////////////////////////////
432-
/// AttachedComponent
433-
//////////////////////////////////////////////////////////////////////////////////
429+
// ////////////////////////////////////////////////////////////////////////////////
430+
// AttachedComponent
431+
// ////////////////////////////////////////////////////////////////////////////////
434432
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
435433
pub enum AttachedComponent {
436434
AttachedComponent(AttachedComponentTpmHandle),
@@ -450,8 +448,8 @@ impl From<AttachedComponent> for AttachedComponentTpmHandle {
450448
}
451449
}
452450

453-
//////////////////////////////////////////////////////////////////////////////////
451+
// ////////////////////////////////////////////////////////////////////////////////
454452
// Act (authenticated timers)
455453
//
456454
// TODO: Figure out how to implement this. This is some kind of counter.
457-
//////////////////////////////////////////////////////////////////////////////////
455+
// ////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)