clippy: fix some warnings in components/canvas (#31563)

This commit is contained in:
eri 2024-03-08 08:24:01 +01:00 committed by GitHub
parent ef3dad3a61
commit 5c4f8cf0df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 90 additions and 98 deletions

View file

@ -38,11 +38,11 @@ fn main() {
.and_then(|pkg| pkg.get("source").and_then(|source| source.as_str()))
.unwrap_or("unknown");
let parsed: Vec<&str> = source.split("#").collect();
let parsed: Vec<&str> = source.split('#').collect();
let revision = if parsed.len() > 1 { parsed[1] } else { source };
let mut revision_module_file = File::create(&revision_file_path).unwrap();
write!(&mut revision_module_file, "{}", format!("\"{}\"", revision)).unwrap();
let mut revision_module_file = File::create(revision_file_path).unwrap();
write!(&mut revision_module_file, "\"{}\"", revision).unwrap();
},
_ => panic!("Cannot find package definitions in lockfile"),
}

View file

@ -530,6 +530,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
/// and the system creates a new native surface that needs to bound to the current
/// context.
#[allow(unsafe_code)]
#[allow(clippy::not_unsafe_ptr_arg_deref)] // It has an unsafe block inside
pub fn replace_native_surface(&mut self, native_widget: *mut c_void, coords: DeviceIntSize) {
debug!("Replacing native surface in compositor: {native_widget:?}");
let connection = self.rendering_context.connection();