Skip to content

Commit

Permalink
chore: Stop allowing, and fix lint clippy::explicit_auto_deref
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Dec 25, 2023
1 parent 1d4ece7 commit 29b49a8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions core/src/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ impl<'gc> NetStream<'gc> {
/// This function should be run during stream ticks and *not* called by AVM
/// code to service seek requests.
pub fn execute_seek(self, context: &mut UpdateContext<'_, 'gc>, offset: f64) {
#![allow(clippy::explicit_auto_deref)] //Erroneous lint

self.trigger_status_event(
context,
vec![("code", "NetStream.Seek.Notify"), ("level", "status")],
Expand Down Expand Up @@ -414,7 +412,7 @@ impl<'gc> NetStream<'gc> {
if matches!(write.stream_type, Some(NetStreamType::Flv { .. })) {
let slice = write.buffer.to_full_slice();
let buffer = slice.data();
let mut reader = FlvReader::from_parts(&*buffer, write.offset);
let mut reader = FlvReader::from_parts(&buffer, write.offset);
let skipping_back = write.stream_time > offset;

loop {
Expand Down Expand Up @@ -757,7 +755,6 @@ impl<'gc> NetStream<'gc> {
/// data is of an unrecognized format. This should be used as a signal to
/// stop stream processing until new data has been retrieved.
pub fn sniff_stream_type(self, context: &mut UpdateContext<'_, 'gc>) -> bool {
#![allow(clippy::explicit_auto_deref)] //Erroneous lint
let mut write = self.0.write(context.gc_context);
let slice = write.buffer.to_full_slice();
let buffer = slice.data();
Expand All @@ -771,7 +768,7 @@ impl<'gc> NetStream<'gc> {

match buffer.get(0..3) {
Some([0x46, 0x4C, 0x56]) => {
let mut reader = FlvReader::from_parts(&*buffer, write.offset);
let mut reader = FlvReader::from_parts(&buffer, write.offset);
match FlvHeader::parse(&mut reader) {
Ok(header) => {
write.offset = reader.into_parts().1;
Expand Down Expand Up @@ -1056,8 +1053,6 @@ impl<'gc> NetStream<'gc> {
///
/// `dt` is in milliseconds.
pub fn tick(self, context: &mut UpdateContext<'_, 'gc>, dt: f64) {
#![allow(clippy::explicit_auto_deref)] //Erroneous lint

let seek_offset = self.0.write(context.gc_context).queued_seek_time.take();
if let Some(offset) = seek_offset {
self.execute_seek(context, offset);
Expand Down Expand Up @@ -1088,7 +1083,7 @@ impl<'gc> NetStream<'gc> {

//At this point we should know our stream type.
if matches!(write.stream_type, Some(NetStreamType::Flv { .. })) {
let mut reader = FlvReader::from_parts(&*buffer, write.offset);
let mut reader = FlvReader::from_parts(&buffer, write.offset);

loop {
let tag = FlvTag::parse(&mut reader);
Expand Down

0 comments on commit 29b49a8

Please sign in to comment.