Skip to content

Commit

Permalink
clippy: fix missing_safety_doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
filnet committed Aug 23, 2021
1 parent 4f0557c commit 898a6af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,13 @@ impl<'a> WindowEvent<'a> {
pub struct DeviceId(pub(crate) platform_impl::DeviceId);

impl DeviceId {
/// Returns a dummy `DeviceId`, useful for unit testing. The only guarantee made about the return
/// value of this function is that it will always be equal to itself and to future values returned
/// by this function. No other guarantees are made. This may be equal to a real `DeviceId`.
/// Returns a dummy `DeviceId`, useful for unit testing.
///
/// # Safety
///
/// The only guarantee made about the return value of this function is that
/// it will always be equal to itself and to future values returned by this function.
/// No other guarantees are made. This may be equal to a real `DeviceId`.
///
/// **Passing this into a winit function will result in undefined behavior.**
pub unsafe fn dummy() -> Self {
Expand Down
9 changes: 6 additions & 3 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ impl Drop for Window {
pub struct WindowId(pub(crate) platform_impl::WindowId);

impl WindowId {
/// Returns a dummy `WindowId`, useful for unit testing. The only guarantee made about the return
/// value of this function is that it will always be equal to itself and to future values returned
/// by this function. No other guarantees are made. This may be equal to a real `WindowId`.
/// Returns a dummy `WindowId`, useful for unit testing.
///
/// # Safety
/// The only guarantee made about the return value of this function is that
/// it will always be equal to itself and to future values returned by this function.
/// No other guarantees are made. This may be equal to a real `WindowId`.
///
/// **Passing this into a winit function will result in undefined behavior.**
pub unsafe fn dummy() -> Self {
Expand Down

0 comments on commit 898a6af

Please sign in to comment.