From 002a7f4572d47b677d97ed9194270b3126b73c00 Mon Sep 17 00:00:00 2001 From: gterzian <2792687+gterzian@users.noreply.github.com> Date: Thu, 5 Jun 2025 22:00:29 +0700 Subject: [PATCH] fix clippy Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> --- components/script/dom/abortsignal.rs | 2 +- components/script/dom/readablestream.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/script/dom/abortsignal.rs b/components/script/dom/abortsignal.rs index 723a1838af1..7de4f85cff9 100644 --- a/components/script/dom/abortsignal.rs +++ b/components/script/dom/abortsignal.rs @@ -150,7 +150,7 @@ impl AbortSignal { ) { // For each algorithm of signal’s abort algorithms: run algorithm. for algo in self.abort_algorithms.borrow().iter() { - self.run_abort_algorithm(cx, global, &algo, realm, can_gc); + self.run_abort_algorithm(cx, global, algo, realm, can_gc); } // Empty signal’s abort algorithms. diff --git a/components/script/dom/readablestream.rs b/components/script/dom/readablestream.rs index b27b73e66eb..6f8d3835de9 100644 --- a/components/script/dom/readablestream.rs +++ b/components/script/dom/readablestream.rs @@ -703,7 +703,7 @@ impl PipeTo { dest.abort(cx, global, error.handle(), can_gc) } else { // Otherwise, return a promise resolved with undefined. - Promise::new_resolved(global, cx, &(), can_gc) + Promise::new_resolved(global, cx, (), can_gc) }; actions.push(promise); } @@ -718,7 +718,7 @@ impl PipeTo { source.cancel(cx, global, error.handle(), can_gc) } else { // Otherwise, return a promise resolved with undefined. - Promise::new_resolved(global, cx, &(), can_gc) + Promise::new_resolved(global, cx, (), can_gc) }; actions.push(promise); } @@ -2088,7 +2088,7 @@ impl ReadableStreamMethods for ReadableStream { } // Let signal be options["signal"] if it exists, or undefined otherwise. - let signal = options.signal.as_ref().map(|signal| &**signal); + let signal = options.signal.as_deref(); // Return ! ReadableStreamPipeTo. self.pipe_to( @@ -2126,7 +2126,7 @@ impl ReadableStreamMethods for ReadableStream { } // Let signal be options["signal"] if it exists, or undefined otherwise. - let signal = options.signal.as_ref().map(|signal| &**signal); + let signal = options.signal.as_deref(); // Let promise be ! ReadableStreamPipeTo(this, transform["writable"], // options["preventClose"], options["preventAbort"], options["preventCancel"], signal).