fix clippy warnings

This commit is contained in:
Dustin J. Mitchell
2022-10-02 19:20:12 +00:00
committed by Tomas Babej
parent 7b35121374
commit 41625f8b11
5 changed files with 13 additions and 34 deletions

View File

@@ -317,7 +317,7 @@ impl<'a> From<String> for RustString<'a> {
}
}
impl<'a> From<&str> for RustString<'static> {
impl From<&str> for RustString<'static> {
fn from(string: &str) -> RustString<'static> {
RustString::String(string.to_string())
}

View File

@@ -276,13 +276,11 @@ where
let mut vec = unsafe { CL::take_val_from_arg(list, CL::null_value()) };
// first, drop each of the elements in turn
for e in vec.drain(..) {
if let Some(e) = e {
// SAFETY:
// - e is a valid Element (promised by caller)
// - e is owned
drop(unsafe { PassByPointer::take_from_ptr_arg(e.as_ptr()) });
}
for e in vec.drain(..).flatten() {
// SAFETY:
// - e is a valid Element (promised by caller)
// - e is owned
drop(unsafe { PassByPointer::take_from_ptr_arg(e.as_ptr()) });
}
// then drop the vector
drop(vec);