fix a couple of simple clipy warnings (#32813)

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2024-07-19 15:18:34 +02:00 committed by GitHub
parent 5eb77592ea
commit 4bf5024ee0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 13 deletions

View file

@ -567,7 +567,7 @@ impl GenericDrawTarget for raqote::DrawTarget {
}; };
self.draw_glyphs( self.draw_glyphs(
&font, font,
run.font.descriptor.pt_size.to_f32_px(), run.font.descriptor.pt_size.to_f32_px(),
&ids, &ids,
&positions, &positions,

View file

@ -340,7 +340,7 @@ fn run_server(
}); });
// Add existing streams to the new browsing context // Add existing streams to the new browsing context
let browsing_context = actors.find::<BrowsingContextActor>(&name); let browsing_context = actors.find::<BrowsingContextActor>(name);
let mut streams = browsing_context.streams.borrow_mut(); let mut streams = browsing_context.streams.borrow_mut();
for (id, stream) in connections { for (id, stream) in connections {
streams.insert(*id, stream.try_clone().unwrap()); streams.insert(*id, stream.try_clone().unwrap());

View file

@ -53,9 +53,7 @@ impl CoreTextFontCache {
} }
let mut cache = cache.write(); let mut cache = cache.write();
let identifier_cache = cache let identifier_cache = cache.entry(font_identifier.clone()).or_default();
.entry(font_identifier.clone())
.or_insert_with(Default::default);
// It could be that between the time of the cache miss above and now, after the write lock // It could be that between the time of the cache miss above and now, after the write lock
// on the cache has been acquired, the cache was populated with the data that we need. Thus // on the cache has been acquired, the cache was populated with the data that we need. Thus

View file

@ -612,9 +612,7 @@ impl Shaper {
} }
pub unsafe fn get_baseline(&self) -> Option<FontBaseline> { pub unsafe fn get_baseline(&self) -> Option<FontBaseline> {
if (*self.font).table_for_tag(BASE).is_none() { (*self.font).table_for_tag(BASE)?;
return None;
}
let mut hanging_baseline = 0; let mut hanging_baseline = 0;
let mut alphabetic_baseline = 0; let mut alphabetic_baseline = 0;

View file

@ -188,7 +188,7 @@ impl WGPU {
move |result: BufferAccessResult| { move |result: BufferAccessResult| {
drop(token); drop(token);
let response = result let response = result
.and_then(|_| { .map(|_| {
let global = &glob; let global = &glob;
let (slice_pointer, range_size) = gfx_select!(buffer_id => let (slice_pointer, range_size) = gfx_select!(buffer_id =>
global.buffer_get_mapped_range(buffer_id, 0, None)) global.buffer_get_mapped_range(buffer_id, 0, None))
@ -201,7 +201,7 @@ impl WGPU {
) )
}; };
Ok(IpcSharedMemory::from_bytes(data)) IpcSharedMemory::from_bytes(data)
}) })
.map_err(|e| e.to_string()); .map_err(|e| e.to_string());
if let Err(e) = if let Err(e) =
@ -671,7 +671,7 @@ impl WGPU {
let response = self let response = self
.global .global
.request_adapter(&options, wgc::instance::AdapterInputs::IdSet(&ids)) .request_adapter(&options, wgc::instance::AdapterInputs::IdSet(&ids))
.and_then(|adapter_id| { .map(|adapter_id| {
let adapter = WebGPUAdapter(adapter_id); let adapter = WebGPUAdapter(adapter_id);
self.adapters.push(adapter); self.adapters.push(adapter);
// TODO: can we do this lazily // TODO: can we do this lazily
@ -684,13 +684,13 @@ impl WGPU {
let features = let features =
gfx_select!(adapter_id => global.adapter_features(adapter_id)) gfx_select!(adapter_id => global.adapter_features(adapter_id))
.unwrap(); .unwrap();
Ok(Adapter { Adapter {
adapter_info: info, adapter_info: info,
adapter_id: adapter, adapter_id: adapter,
features, features,
limits, limits,
channel: WebGPU(self.sender.clone()), channel: WebGPU(self.sender.clone()),
}) }
}) })
.map_err(|e| e.to_string()); .map_err(|e| e.to_string());