Skip to content

Commit

Permalink
Fix configuration for undocumented_unsafe_blocks lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Sep 29, 2023
1 parent c9d2f25 commit 0e1b285
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
semicolon-outside-block-ignore-multiline = true
accept-comment-above-statement = true
accept-comment-above-attributes = true
10 changes: 5 additions & 5 deletions crates/ironrdp-cliprdr-native/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ impl WinClipboard {

// We need to receive winapi messages in the main thread, so we need to add a subclass to
// the window.
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)
};
//
// 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 { SetWindowSubclass(window, Some(clipboard_subproc), 0, Box::into_raw(ctx) as usize) };

if winapi_result == FALSE {
return Err(WinCliprdrError::WindowSubclass);
Expand Down

0 comments on commit 0e1b285

Please sign in to comment.