Add the Safety section header and deny intra_doc_link_failures

This commit is contained in:
Michael Watzko 2020-06-10 16:36:35 +02:00
commit 75571b10c9

View file

@ -1,5 +1,6 @@
#![no_std] #![no_std]
#![allow(unused)] #![allow(unused)]
#![deny(intra_doc_link_resolution_failure)]
extern crate byteorder; extern crate byteorder;
extern crate embedded_hal as hal; extern crate embedded_hal as hal;
@ -265,9 +266,14 @@ impl<
Ok(ip) Ok(ip)
} }
/// This is unsafe because it cannot set taken sockets back to be uninitialized /// # Safety
/// It assumes, none of the old sockets will used anymore. Otherwise that socket ///
/// will have undefined behavior. /// 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<SpiError, ChipSelectError>> { pub unsafe fn reset(&mut self) -> Result<(), TransferError<SpiError, ChipSelectError>> {
self.write_to( self.write_to(
Register::CommonRegister(0x00_00_u16), Register::CommonRegister(0x00_00_u16),