Fix some build warnings

- Mark some instances of unused fields and variables as as allowed,
  when they are used for memory management.
- Remove the use of some deprecated function.s

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2023-01-11 12:18:44 +01:00
parent 9a03911abf
commit c021df027a
5 changed files with 11 additions and 12 deletions

View file

@ -38,7 +38,7 @@ use dom_struct::dom_struct;
use euclid::default::{Rect, Size2D};
use html5ever::{LocalName, Prefix};
use image::codecs::png::PngEncoder;
use image::ColorType;
use image::{ColorType, ImageEncoder};
use ipc_channel::ipc::{self as ipcchan, IpcSharedMemory};
use js::error::throw_type_error;
use js::rust::HandleValue;
@ -427,7 +427,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
// FIXME(nox): https://github.com/image-rs/image-png/issues/86
// FIXME(nox): https://github.com/image-rs/image-png/issues/87
PngEncoder::new(&mut png)
.encode(&file, self.Width(), self.Height(), ColorType::Rgba8)
.write_image(&file, self.Width(), self.Height(), ColorType::Rgba8)
.unwrap();
let mut url = "data:image/png;base64,".to_owned();
// FIXME(nox): Should this use base64::URL_SAFE?