Skip to content

Commit 2f4d442

Browse files
committed
Changing the with_options methods to no longer take EventListenerOptions by reference (since it's Copy anyways)
1 parent 16e67e5 commit 2f4d442

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

crates/events/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl EventListener {
286286
/// #
287287
/// let options = EventListenerOptions::enable_prevent_default();
288288
///
289-
/// EventListener::new_with_options(target, event_type, &options, callback)
289+
/// EventListener::new_with_options(target, event_type, options, callback)
290290
/// # ;
291291
/// ```
292292
///
@@ -306,7 +306,7 @@ impl EventListener {
306306
/// // This runs the event listener in the capture phase, rather than the bubble phase
307307
/// let options = EventListenerOptions::run_in_capture_phase();
308308
///
309-
/// EventListener::new_with_options(target, event_type, &options, callback)
309+
/// EventListener::new_with_options(target, event_type, options, callback)
310310
/// # ;
311311
/// ```
312312
///
@@ -415,7 +415,7 @@ impl EventListener {
415415
/// #
416416
/// let options = EventListenerOptions::enable_prevent_default();
417417
///
418-
/// let listener = EventListener::new_with_options(&target, "touchstart", &options, move |event| {
418+
/// let listener = EventListener::new_with_options(&target, "touchstart", options, move |event| {
419419
/// event.prevent_default();
420420
///
421421
/// // ...
@@ -433,7 +433,7 @@ impl EventListener {
433433
/// #
434434
/// let options = EventListenerOptions::run_in_capture_phase();
435435
///
436-
/// let listener = EventListener::new_with_options(&target, "click", &options, move |event| {
436+
/// let listener = EventListener::new_with_options(&target, "click", options, move |event| {
437437
/// // Stop the event from bubbling
438438
/// event.stop_propagation();
439439
///
@@ -444,7 +444,7 @@ impl EventListener {
444444
pub fn new_with_options<S, F>(
445445
target: &EventTarget,
446446
event_type: S,
447-
options: &EventListenerOptions,
447+
options: EventListenerOptions,
448448
callback: F,
449449
) -> Self
450450
where
@@ -479,7 +479,7 @@ impl EventListener {
479479
/// #
480480
/// let options = EventListenerOptions::enable_prevent_default();
481481
///
482-
/// let listener = EventListener::once_with_options(&target, "load", &options, move |event| {
482+
/// let listener = EventListener::once_with_options(&target, "load", options, move |event| {
483483
/// event.prevent_default();
484484
///
485485
/// // ...
@@ -497,7 +497,7 @@ impl EventListener {
497497
/// #
498498
/// let options = EventListenerOptions::run_in_capture_phase();
499499
///
500-
/// let listener = EventListener::once_with_options(&target, "click", &options, move |event| {
500+
/// let listener = EventListener::once_with_options(&target, "click", options, move |event| {
501501
/// // Stop the event from bubbling
502502
/// event.stop_propagation();
503503
///
@@ -508,7 +508,7 @@ impl EventListener {
508508
pub fn once_with_options<S, F>(
509509
target: &EventTarget,
510510
event_type: S,
511-
options: &EventListenerOptions,
511+
options: EventListenerOptions,
512512
callback: F,
513513
) -> Self
514514
where

crates/events/tests/web.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn new_with_options() -> impl Future<Item = (), Error = JsValue> {
7878
let _handler = EventListener::new_with_options(
7979
&body,
8080
"click",
81-
&EventListenerOptions {
81+
EventListenerOptions {
8282
phase: EventListenerPhase::Capture,
8383
passive: false,
8484
},
@@ -105,7 +105,7 @@ fn once_with_options() -> impl Future<Item = (), Error = JsValue> {
105105
let _handler = EventListener::once_with_options(
106106
&body,
107107
"click",
108-
&EventListenerOptions {
108+
EventListenerOptions {
109109
phase: EventListenerPhase::Capture,
110110
passive: false,
111111
},

0 commit comments

Comments
 (0)