Fix warnings after latest rust upgrade (#33043)

This fixes various unused code warnings after the recent rust upgrade.
Some of the dead code is maintained, as it is quite likely that it will
be used in future changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-08-14 09:00:16 +02:00 committed by GitHub
parent 380348e4df
commit 6be99241c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 19 additions and 34 deletions

View file

@ -49,11 +49,11 @@ use crate::script_runtime::JSContext as SafeJSContext;
#[derive(Clone, Copy)]
pub struct NonCallbackInterfaceObjectClass {
/// The SpiderMonkey class structure.
pub class: JSClass,
pub _class: JSClass,
/// The prototype id of that interface, used in the hasInstance hook.
pub proto_id: PrototypeList::ID,
pub _proto_id: PrototypeList::ID,
/// The prototype depth of that interface, used in the hasInstance hook.
pub proto_depth: u16,
pub _proto_depth: u16,
/// The string representation of the object.
pub representation: &'static [u8],
}
@ -69,7 +69,7 @@ impl NonCallbackInterfaceObjectClass {
proto_depth: u16,
) -> NonCallbackInterfaceObjectClass {
NonCallbackInterfaceObjectClass {
class: JSClass {
_class: JSClass {
name: c"Function".as_ptr(),
flags: 0,
cOps: &constructor_behavior.0,
@ -77,8 +77,8 @@ impl NonCallbackInterfaceObjectClass {
ext: 0 as *const _,
oOps: &OBJECT_OPS,
},
proto_id,
proto_depth,
_proto_id: proto_id,
_proto_depth: proto_depth,
representation: string_rep,
}
}

View file

@ -36,7 +36,7 @@ pub struct IIRFilterNode {
impl IIRFilterNode {
#[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
_window: &Window,
context: &BaseAudioContext,
options: &IIRFilterOptions,
) -> Fallible<IIRFilterNode> {

View file

@ -22,8 +22,8 @@ use crate::dom::document::Document;
use crate::dom::eventtarget::EventTarget;
pub enum MediaQueryListMatchState {
Same(bool),
Changed(bool),
Same,
Changed,
}
#[dom_struct]
@ -59,12 +59,12 @@ impl MediaQueryList {
let result = if let Some(old_matches) = self.last_match_state.get() {
if old_matches == matches {
MediaQueryListMatchState::Same(matches)
MediaQueryListMatchState::Same
} else {
MediaQueryListMatchState::Changed(matches)
MediaQueryListMatchState::Changed
}
} else {
MediaQueryListMatchState::Changed(matches)
MediaQueryListMatchState::Changed
};
self.last_match_state.set(Some(matches));

View file

@ -59,8 +59,8 @@ impl fmt::Display for TexImageValidationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::TexImageValidationError::*;
let description = match *self {
InvalidTextureTarget(_) => "Invalid texture target",
TextureTargetNotBound(_) => "Texture was not bound",
InvalidTextureTarget(texture_id) => &format!("Invalid texture target ({texture_id})"),
TextureTargetNotBound(texture_id) => &format!("Texture was not bound {texture_id}"),
InvalidCubicTextureDimensions => {
"Invalid dimensions were given for a cubic texture target"
},

View file

@ -2460,7 +2460,7 @@ impl Window {
pub fn evaluate_media_queries_and_report_changes(&self) {
rooted_vec!(let mut mql_list);
self.media_query_lists.for_each(|mql| {
if let MediaQueryListMatchState::Changed(_) = mql.evaluate_changes() {
if let MediaQueryListMatchState::Changed = mql.evaluate_changes() {
// Recording list of changed Media Queries
mql_list.push(Dom::from_ref(&*mql));
}