From 21329b6bec0b6096e24cd3c55d244108fa4ba2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Fri, 29 Sep 2023 02:33:32 -0400 Subject: [PATCH] Fix configuration for undocumented_unsafe_blocks lint --- clippy.toml | 2 ++ crates/ironrdp-cliprdr-native/src/windows.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clippy.toml b/clippy.toml index 0ac765717..2ded6b073 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1,3 @@ semicolon-outside-block-ignore-multiline = true +accept-comment-above-statement = true +accept-comment-above-attributes = true diff --git a/crates/ironrdp-cliprdr-native/src/windows.rs b/crates/ironrdp-cliprdr-native/src/windows.rs index 18aba2ee6..3d638af46 100644 --- a/crates/ironrdp-cliprdr-native/src/windows.rs +++ b/crates/ironrdp-cliprdr-native/src/windows.rs @@ -129,9 +129,10 @@ impl WinClipboard { // We need to receive winapi messages in the main thread, so we need to add a subclass to // the window. + // + // SAFETY: `window` is a valid window handle, `clipboard_subproc` is in the static memory, + // `ctx` is valid and its ownership is transferred to the subclass via `into_raw`. let winapi_result = unsafe { - // SAFETY: `window` is a valid window handle, `clipboard_subproc` is in the static memory, - // `ctx` is valid and its ownership is transferred to the subclass via `into_raw`. SetWindowSubclass(window, Some(clipboard_subproc), 0, Box::into_raw(ctx) as usize) };