diff --git a/core/src/avm1/debug.rs b/core/src/avm1/debug.rs index f6401a635..09f9a8811 100644 --- a/core/src/avm1/debug.rs +++ b/core/src/avm1/debug.rs @@ -1,5 +1,6 @@ use crate::avm1::activation::Activation; use crate::avm1::{AvmString, Object, ObjectPtr, TObject, Value}; +use std::fmt::Write; #[allow(dead_code)] pub struct VariableDumper<'a> { @@ -174,7 +175,9 @@ impl<'a> VariableDumper<'a> { self.depth += 1; for key in keys.into_iter() { - self.output.push_str(&format!("{}.{}", name, key)); + self.output.push_str(name); + self.output.push('.'); + let _ = write!(self.output, "{}", key); self.output.push_str(" = "); self.print_property(object, key, activation); self.output.push('\n'); diff --git a/core/src/avm1/property_decl.rs b/core/src/avm1/property_decl.rs index f8349883c..3f422de6f 100644 --- a/core/src/avm1/property_decl.rs +++ b/core/src/avm1/property_decl.rs @@ -114,7 +114,7 @@ impl Declaration { /// /// # Usage: /// -/// ```rust,ignored +/// ```rust,ignore /// const DECLS: &'static [Declaration] = declare_properties! { /// "length" => property(get_length); /// "filters" => property(get_filters, set_filters); @@ -126,7 +126,7 @@ impl Declaration { /// "scale" => float(0.85); /// // all declarations can also specify attributes /// "hidden" => string("shh!"; DONT_ENUM | DONT_DELETE | READ_ONLY); -/// } +/// }; /// ``` macro_rules! declare_properties { ( $($name:literal => $kind:ident($($args:tt)*);)* ) => { diff --git a/render/canvas/src/lib.rs b/render/canvas/src/lib.rs index 856d0fb55..41403b209 100644 --- a/render/canvas/src/lib.rs +++ b/render/canvas/src/lib.rs @@ -127,7 +127,7 @@ impl BitmapDataStorage { .dyn_into() .unwrap(); - let _ = context.put_image_data(&data, 0.0, 0.0).unwrap(); + context.put_image_data(&data, 0.0, 0.0).unwrap(); BitmapDataStorage::CanvasElement(canvas, context) } diff --git a/swf/src/string.rs b/swf/src/string.rs index d9f12a885..2f1945520 100644 --- a/swf/src/string.rs +++ b/swf/src/string.rs @@ -248,7 +248,7 @@ impl<'a> From<&'a str> for &'a SwfStr { } } -impl<'a, T: ?Sized + AsRef> PartialEq for SwfStr { +impl> PartialEq for SwfStr { fn eq(&self, other: &T) -> bool { &self.string == other.as_ref().as_bytes() } diff --git a/web/src/audio.rs b/web/src/audio.rs index 0c31e2c35..7d42092fe 100644 --- a/web/src/audio.rs +++ b/web/src/audio.rs @@ -122,7 +122,7 @@ struct SoundInstance { impl Drop for SoundInstance { fn drop(&mut self) { if let SoundInstanceType::AudioBuffer(instance) = &self.instance_type { - let _ = instance.buffer_source_node.set_onended(None); + instance.buffer_source_node.set_onended(None); let _ = instance.node.disconnect(); } } @@ -474,7 +474,7 @@ impl WebAudioBackend { let closure = Closure::once_into_js(Box::new(ended_handler) as Box); // Note that we add the ended event to the AudioBufferSourceNode; an audio envelope adds more nodes // in the graph, but these nodes don't fire the ended event. - let _ = buffer_source_node.set_onended(Some(closure.as_ref().unchecked_ref())); + buffer_source_node.set_onended(Some(closure.as_ref().unchecked_ref())); instance_handle } diff --git a/wstr/src/pattern.rs b/wstr/src/pattern.rs index e7344f44b..07ebdf2b5 100644 --- a/wstr/src/pattern.rs +++ b/wstr/src/pattern.rs @@ -263,7 +263,7 @@ impl<'a, T: Copy, U: Copy + Eq + TryFrom> Predicate for AnyOf<'a, U> { pub struct FnPred(F); -impl<'a, T: Into, F: Fn(u16) -> bool> Predicate for FnPred { +impl, F: Fn(u16) -> bool> Predicate for FnPred { fn is_match(&self, c: T) -> bool { (self.0)(c.into()) }