From 75571b10c9e84c70908a394acb64c9ab7c837a48 Mon Sep 17 00:00:00 2001 From: Michael Watzko Date: Wed, 10 Jun 2020 16:36:35 +0200 Subject: [PATCH] Add the Safety section header and deny intra_doc_link_failures --- src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 12a60b1..2eb9bfb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![no_std] #![allow(unused)] +#![deny(intra_doc_link_resolution_failure)] extern crate byteorder; extern crate embedded_hal as hal; @@ -265,9 +266,14 @@ impl< Ok(ip) } - /// This is unsafe because it cannot set taken sockets back to be uninitialized - /// It assumes, none of the old sockets will used anymore. Otherwise that socket - /// will have undefined behavior. + /// # Safety + /// + /// This is unsafe because it cannot set taken [`Sockets`] back to be uninitialized + /// It assumes, none of the old sockets will used beyond this call. Because the + /// state of the [`Sockets`] is no longer in sync with the W5500, their usage might + /// result in undefined behavior. + /// + /// [`Sockets`]: Socket pub unsafe fn reset(&mut self) -> Result<(), TransferError> { self.write_to( Register::CommonRegister(0x00_00_u16),