Skip to content

Commit 9875e6e

Browse files
committed
fix(library-config): satisfy platform clippy lints
1 parent 6f2f42e commit 9875e6e

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

libdd-library-config/src/otel_process_ctx/reader/copy_pipe_unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fn last_error(context: &'static str) -> io::Error {
237237
mod tests {
238238
use core::ptr;
239239

240-
use super::{CopyPipe, ProcessMemoryCopy};
240+
use super::{io, CopyPipe, ProcessMemoryCopy};
241241

242242
#[test]
243243
#[cfg_attr(miri, ignore)]
@@ -290,7 +290,7 @@ mod tests {
290290
.copy(unsafe { address.cast::<u8>().add(page_size - 1) }, 2)
291291
.expect_err("a copy crossing into inaccessible memory should fail");
292292

293-
assert_eq!(err.err.kind(), std::io::ErrorKind::WouldBlock);
293+
assert_eq!(err.err.kind(), io::ErrorKind::WouldBlock);
294294
assert!(!err.pipe_dirty);
295295
// SAFETY: address and len came from mmap above.
296296
assert_eq!(unsafe { libc::munmap(address, len) }, 0);

libdd-library-config/src/otel_process_ctx/reader/copy_pipe_windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn last_error(context: &'static str) -> io::Error {
214214
mod tests {
215215
use core::{ffi::c_void, ptr};
216216

217-
use super::{CopyPipe, ProcessMemoryCopy};
217+
use super::{io, CopyPipe, ProcessMemoryCopy};
218218

219219
const MEM_COMMIT: u32 = 0x1000;
220220
const MEM_RESERVE: u32 = 0x2000;
@@ -276,7 +276,7 @@ mod tests {
276276
.copy(address.cast(), 1)
277277
.expect_err("inaccessible memory should fail");
278278

279-
assert_eq!(err.err.kind(), std::io::ErrorKind::WouldBlock);
279+
assert_eq!(err.err.kind(), io::ErrorKind::WouldBlock);
280280
assert!(!err.pipe_dirty);
281281
// SAFETY: address was returned by VirtualAlloc and MEM_RELEASE requires size zero.
282282
assert_ne!(unsafe { VirtualFree(address, 0, MEM_RELEASE) }, 0);

libdd-library-config/src/otel_process_ctx/reader/linux.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ mod tests {
8282
mod with_writer {
8383
use core::sync::atomic::Ordering;
8484

85+
use super::super::io;
8586
use crate::otel_process_ctx::ProcessContextSelfReader;
8687
use crate::otel_process_ctx::{writer::MappingHeader, UNPUBLISHED_OR_UPDATING};
8788

@@ -103,7 +104,7 @@ mod tests {
103104
let error = reader
104105
.read()
105106
.expect_err("read should report writer in progress");
106-
assert_eq!(error.kind(), std::io::ErrorKind::WouldBlock);
107+
assert_eq!(error.kind(), io::ErrorKind::WouldBlock);
107108

108109
// SAFETY: the mapping remains live and this restores the field changed above.
109110
unsafe {
@@ -125,7 +126,7 @@ mod tests {
125126
let error = reader
126127
.read()
127128
.expect_err("raw test payload is not a protobuf context");
128-
assert_eq!(error.kind(), std::io::ErrorKind::InvalidData);
129+
assert_eq!(error.kind(), io::ErrorKind::InvalidData);
129130

130131
crate::otel_process_ctx::unpublish().expect("unpublish should succeed");
131132
assert!(ProcessContextSelfReader::new().is_err());

0 commit comments

Comments
 (0)