diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9ce2700..35fa4233 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: - name: Build the container run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools - name: Run the tests - 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 + 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 # Check that the documentation builds as well. docs: diff --git a/tss-esapi/src/abstraction/nv.rs b/tss-esapi/src/abstraction/nv.rs index 4826fa7c..76646fc7 100644 --- a/tss-esapi/src/abstraction/nv.rs +++ b/tss-esapi/src/abstraction/nv.rs @@ -202,7 +202,7 @@ impl Read for NvReaderWriter<'_> { let res = self .context .nv_read(self.auth_handle, self.nv_idx, size, self.offset as u16) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; + .map_err(std::io::Error::other)?; buf[0..size as usize].copy_from_slice(&res); self.offset += size as usize; @@ -219,11 +219,10 @@ impl std::io::Write for NvReaderWriter<'_> { let desired_size = std::cmp::min(buf.len(), self.data_size - self.offset); let size = std::cmp::min(self.buffer_size, desired_size) as u16; - let data = MaxNvBuffer::from_bytes(&buf[0..size.into()]) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; + let data = MaxNvBuffer::from_bytes(&buf[0..size.into()]).map_err(std::io::Error::other)?; self.context .nv_write(self.auth_handle, self.nv_idx, data, self.offset as u16) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; + .map_err(std::io::Error::other)?; self.offset += size as usize; Ok(size.into()) diff --git a/tss-esapi/src/structures/lists/tagged_pcr_property.rs b/tss-esapi/src/structures/lists/tagged_pcr_property.rs index 8fceacd1..b7ffe870 100644 --- a/tss-esapi/src/structures/lists/tagged_pcr_property.rs +++ b/tss-esapi/src/structures/lists/tagged_pcr_property.rs @@ -34,7 +34,7 @@ impl TaggedPcrPropertyList { self.tagged_pcr_properties .iter() .fold(Vec::<&TaggedPcrSelect>::new(), |mut acc, tps| { - if tps.selected_pcrs().iter().any(|&ps| ps == pcr_slot) { + if tps.selected_pcrs().contains(&pcr_slot) { acc.push(tps); } acc