diff options
author | Rodion Borovyk <rodion.borovyk@gmail.com> | 2024-07-19 15:18:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 13:18:34 +0000 |
commit | 4bf5024ee058784d4f505fe5ec279cd87a7fd2b4 (patch) | |
tree | c0d77684bfdbcaeeddcda9b4518fb19ce41d730e /components | |
parent | 5eb77592ea8a0ba83e81d5e99f7beb54a8e48712 (diff) | |
download | servo-4bf5024ee058784d4f505fe5ec279cd87a7fd2b4.tar.gz servo-4bf5024ee058784d4f505fe5ec279cd87a7fd2b4.zip |
fix a couple of simple clipy warnings (#32813)
Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
Diffstat (limited to 'components')
-rw-r--r-- | components/canvas/raqote_backend.rs | 2 | ||||
-rw-r--r-- | components/devtools/lib.rs | 2 | ||||
-rw-r--r-- | components/fonts/platform/macos/core_text_font_cache.rs | 4 | ||||
-rw-r--r-- | components/fonts/shaper.rs | 4 | ||||
-rw-r--r-- | components/webgpu/wgpu_thread.rs | 10 |
5 files changed, 9 insertions, 13 deletions
diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index 359b0271368..1ddf7906845 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -567,7 +567,7 @@ impl GenericDrawTarget for raqote::DrawTarget { }; self.draw_glyphs( - &font, + font, run.font.descriptor.pt_size.to_f32_px(), &ids, &positions, diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index caa55bf425b..6b6b407d3bd 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -340,7 +340,7 @@ fn run_server( }); // 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(); for (id, stream) in connections { streams.insert(*id, stream.try_clone().unwrap()); diff --git a/components/fonts/platform/macos/core_text_font_cache.rs b/components/fonts/platform/macos/core_text_font_cache.rs index bd59550d45e..6f41a25ce70 100644 --- a/components/fonts/platform/macos/core_text_font_cache.rs +++ b/components/fonts/platform/macos/core_text_font_cache.rs @@ -53,9 +53,7 @@ impl CoreTextFontCache { } let mut cache = cache.write(); - let identifier_cache = cache - .entry(font_identifier.clone()) - .or_insert_with(Default::default); + let identifier_cache = cache.entry(font_identifier.clone()).or_default(); // 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 diff --git a/components/fonts/shaper.rs b/components/fonts/shaper.rs index f5dbb5b0c74..addd44d8b26 100644 --- a/components/fonts/shaper.rs +++ b/components/fonts/shaper.rs @@ -612,9 +612,7 @@ impl Shaper { } pub unsafe fn get_baseline(&self) -> Option<FontBaseline> { - if (*self.font).table_for_tag(BASE).is_none() { - return None; - } + (*self.font).table_for_tag(BASE)?; let mut hanging_baseline = 0; let mut alphabetic_baseline = 0; diff --git a/components/webgpu/wgpu_thread.rs b/components/webgpu/wgpu_thread.rs index b97e8167399..61722216e43 100644 --- a/components/webgpu/wgpu_thread.rs +++ b/components/webgpu/wgpu_thread.rs @@ -188,7 +188,7 @@ impl WGPU { move |result: BufferAccessResult| { drop(token); let response = result - .and_then(|_| { + .map(|_| { let global = &glob; let (slice_pointer, range_size) = gfx_select!(buffer_id => 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()); if let Err(e) = @@ -671,7 +671,7 @@ impl WGPU { let response = self .global .request_adapter(&options, wgc::instance::AdapterInputs::IdSet(&ids)) - .and_then(|adapter_id| { + .map(|adapter_id| { let adapter = WebGPUAdapter(adapter_id); self.adapters.push(adapter); // TODO: can we do this lazily @@ -684,13 +684,13 @@ impl WGPU { let features = gfx_select!(adapter_id => global.adapter_features(adapter_id)) .unwrap(); - Ok(Adapter { + Adapter { adapter_info: info, adapter_id: adapter, features, limits, channel: WebGPU(self.sender.clone()), - }) + } }) .map_err(|e| e.to_string()); |