diff --git a/Cargo.toml b/Cargo.toml index 1646bde8..505fc6b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,7 @@ unit_bindings = "warn" # == Safer unsafe == # undocumented_unsafe_blocks = "warn" +unnecessary_safety_comment = "warn" multiple_unsafe_ops_per_block = "warn" transmute_ptr_to_ptr = "warn" as_ptr_cast_mut = "warn" diff --git a/crates/ironrdp-cliprdr-native/src/windows/clipboard_impl.rs b/crates/ironrdp-cliprdr-native/src/windows/clipboard_impl.rs index cd651da7..2025783c 100644 --- a/crates/ironrdp-cliprdr-native/src/windows/clipboard_impl.rs +++ b/crates/ironrdp-cliprdr-native/src/windows/clipboard_impl.rs @@ -304,7 +304,9 @@ fn filter_format_ids(formats: &mut HashSet) { /// WinAPI event loop for clipboard processing /// -/// SAFETY: This function should only be used for windows subclassing api via `SetWindowSubclass`. +/// # Safety +/// +/// This function should only be used for windows subclassing api via `SetWindowSubclass`. pub(crate) unsafe extern "system" fn clipboard_subproc( hwnd: HWND, msg: u32, diff --git a/crates/ironrdp-cliprdr-native/src/windows/utils.rs b/crates/ironrdp-cliprdr-native/src/windows/utils.rs index b890ef98..8ef32bb2 100644 --- a/crates/ironrdp-cliprdr-native/src/windows/utils.rs +++ b/crates/ironrdp-cliprdr-native/src/windows/utils.rs @@ -52,7 +52,9 @@ impl Drop for GlobalMemoryBuffer { /// Render data format into the clipboard. /// -/// SAFETY: This function should only be called in the context of processing +/// # Safety +/// +/// This function should only be called in the context of processing /// `WM_RENDERFORMAT` or `WM_RENDERALLFORMATS` messages inside WinAPI message loop. pub(crate) unsafe fn render_format(format: ClipboardFormatId, data: &[u8]) -> WinCliprdrResult<()> { // Allocate buffer and copy data into it