refactor: add unnecessary_safety_comment clippy safety lint

This commit is contained in:
Alexandr Yusiuk
2025-07-18 16:39:23 -04:00
committed by Benoît Cortier
parent c6d606e670
commit dc5da26fb9
3 changed files with 7 additions and 2 deletions
+1
View File
@@ -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"
@@ -304,7 +304,9 @@ fn filter_format_ids(formats: &mut HashSet<ClipboardFormatId>) {
/// 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,
@@ -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