Janitor: Fix clippy::missing_safety_doc

This commit is contained in:
Tobias Hunger 2021-08-05 19:30:07 +02:00 committed by Simon Hausmann
parent 9dcd107e84
commit cbdea7c9c7
2 changed files with 8 additions and 1 deletions

View file

@ -1022,10 +1022,16 @@ impl core::ops::Deref for FlickableDataBox {
}
}
/// # Safety
/// This must be called using a non-null pointer pointing to a chunk of memory big enough to
/// hold a FlickableDataBox
#[no_mangle]
pub unsafe extern "C" fn sixtyfps_flickable_data_init(data: *mut FlickableDataBox) {
std::ptr::write(data, FlickableDataBox::default());
}
/// # Safety
/// This must be called using a non-null pointer pointing to an initialized FlickableDataBox
#[no_mangle]
pub unsafe extern "C" fn sixtyfps_flickable_data_free(data: *mut FlickableDataBox) {
std::ptr::drop_in_place(data);

View file

@ -99,7 +99,8 @@ pub trait PropertyInfo<Item, Value> {
/// Calls Property::link_two_ways with the property represented here and the property pointer
///
/// Safety: the property2 must be a pinned pointer to a Property of the same type
/// # Safety
/// the property2 must be a pinned pointer to a Property of the same type
#[allow(unsafe_code)]
unsafe fn link_two_ways(&self, item: Pin<&Item>, property2: *const ());
}