clippy: fix result_unit_err warnings (#31791)

* clippy: fix `result_unit_err` warnings

* feat: fix result warnings in script

* doc: document `generate_key` return type

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* feat: add back result to RangeRequestBounds::get_final

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
eri 2024-03-21 13:51:45 +01:00 committed by GitHub
parent ea62a5e24f
commit da696b7e57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 175 additions and 191 deletions

View file

@ -1036,14 +1036,14 @@ impl gfx_traits::WebrenderApi for FontCacheWR {
struct CanvasWebrenderApi(CompositorProxy);
impl canvas_paint_thread::WebrenderApi for CanvasWebrenderApi {
fn generate_key(&self) -> Result<ImageKey, ()> {
fn generate_key(&self) -> Option<ImageKey> {
let (sender, receiver) = unbounded();
let _ = self
.0
.send(CompositorMsg::Forwarded(ForwardedToCompositorMsg::Canvas(
CanvasToCompositorMsg::GenerateKey(sender),
)));
receiver.recv().map_err(|_| ())
receiver.recv().ok()
}
fn update_images(&self, updates: Vec<canvas_paint_thread::ImageUpdate>) {
let _ = self