From 898a6af3072c3557924552491d3466b133af4f72 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Mon, 23 Aug 2021 23:56:48 +0200 Subject: [PATCH] clippy: fix missing_safety_doc warnings --- src/event.rs | 10 +++++++--- src/window.rs | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/event.rs b/src/event.rs index 0c5b5db1b6b..8c7a6f278ac 100644 --- a/src/event.rs +++ b/src/event.rs @@ -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 { diff --git a/src/window.rs b/src/window.rs index 3edfab638a0..b74d9eaccac 100644 --- a/src/window.rs +++ b/src/window.rs @@ -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 {