Skip to content

Commit 79383f1

Browse files
committed
Fixed lint errors reported by Clippy in 1.87.
- Fixes lint errors reported by clippy in version 1.87. - Changes the version of rust to 1.87 for the valgrind tests in order to avoid problems with crates that are starting to require edition 2024. Signed-off-by: Jesper Brynolf <[email protected]>
1 parent 0eb146d commit 79383f1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- name: Build the container
9898
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
9999
- name: Run the tests
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
100+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUST_TOOLCHAIN_VERSION="1.87" ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
101101

102102
# Check that the documentation builds as well.
103103
docs:

tss-esapi/src/abstraction/nv.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl Read for NvReaderWriter<'_> {
202202
let res = self
203203
.context
204204
.nv_read(self.auth_handle, self.nv_idx, size, self.offset as u16)
205-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
205+
.map_err(std::io::Error::other)?;
206206
buf[0..size as usize].copy_from_slice(&res);
207207
self.offset += size as usize;
208208

@@ -219,11 +219,10 @@ impl std::io::Write for NvReaderWriter<'_> {
219219
let desired_size = std::cmp::min(buf.len(), self.data_size - self.offset);
220220
let size = std::cmp::min(self.buffer_size, desired_size) as u16;
221221

222-
let data = MaxNvBuffer::from_bytes(&buf[0..size.into()])
223-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
222+
let data = MaxNvBuffer::from_bytes(&buf[0..size.into()]).map_err(std::io::Error::other)?;
224223
self.context
225224
.nv_write(self.auth_handle, self.nv_idx, data, self.offset as u16)
226-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
225+
.map_err(std::io::Error::other)?;
227226
self.offset += size as usize;
228227

229228
Ok(size.into())

tss-esapi/src/structures/lists/tagged_pcr_property.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl TaggedPcrPropertyList {
3434
self.tagged_pcr_properties
3535
.iter()
3636
.fold(Vec::<&TaggedPcrSelect>::new(), |mut acc, tps| {
37-
if tps.selected_pcrs().iter().any(|&ps| ps == pcr_slot) {
37+
if tps.selected_pcrs().contains(&pcr_slot) {
3838
acc.push(tps);
3939
}
4040
acc

0 commit comments

Comments
 (0)