From 8b2d3677fb6913634796f83acb4485d58d0200bd Mon Sep 17 00:00:00 2001 From: John Nunley Date: Thu, 9 Jan 2025 19:48:25 -0800 Subject: [PATCH] breaking: Rename EventLoop::try_new to new So this is how it begins. Signed-off-by: John Nunley --- README.md | 2 +- benches/timer.rs | 6 +++--- doc/src/adapt_io_example.rs | 2 +- doc/src/async_example.rs | 2 +- doc/src/timer_example.rs | 2 +- examples/high_precision.rs | 2 +- examples/timer.rs | 2 +- src/io.rs | 8 +++---- src/lib.rs | 2 +- src/loop_logic.rs | 42 ++++++++++++++++++------------------- src/macros.rs | 2 +- src/sources/channel.rs | 6 +++--- src/sources/futures.rs | 4 ++-- src/sources/generic.rs | 8 +++---- src/sources/mod.rs | 4 ++-- src/sources/ping.rs | 10 ++++----- src/sources/timer.rs | 16 +++++++------- src/sources/transient.rs | 12 +++++------ tests/signals.rs | 6 +++--- 19 files changed, 69 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 6ac533ae..8f669f9a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ fn main() { // just annotate the type here; the actual data is provided later in the // run() call. let mut event_loop: EventLoop = - EventLoop::try_new().expect("Failed to initialize the event loop!"); + EventLoop::new().expect("Failed to initialize the event loop!"); // Retrieve a handle. It is used to insert new sources into the event loop // It can be cloned, allowing you to insert sources from within source diff --git a/benches/timer.rs b/benches/timer.rs index 144d77de..c26beeb0 100644 --- a/benches/timer.rs +++ b/benches/timer.rs @@ -4,7 +4,7 @@ use calloop::timer::TimeoutAction; use criterion::{criterion_group, criterion_main, Criterion}; fn single(c: &mut Criterion) { - let mut event_loop = calloop::EventLoop::<()>::try_new().unwrap(); + let mut event_loop = calloop::EventLoop::<()>::new().unwrap(); let loop_handle = event_loop.handle(); let timer = calloop::timer::Timer::from_duration(Duration::from_secs(60 * 10)); @@ -27,7 +27,7 @@ fn single(c: &mut Criterion) { } fn mixed(c: &mut Criterion) { - let mut event_loop = calloop::EventLoop::<()>::try_new().unwrap(); + let mut event_loop = calloop::EventLoop::<()>::new().unwrap(); let loop_handle = event_loop.handle(); let timer = calloop::timer::Timer::from_duration(Duration::from_secs(60 * 10 - 1)); @@ -60,7 +60,7 @@ fn mixed(c: &mut Criterion) { } fn mixed_multiple(c: &mut Criterion) { - let mut event_loop = calloop::EventLoop::<()>::try_new().unwrap(); + let mut event_loop = calloop::EventLoop::<()>::new().unwrap(); let loop_handle = event_loop.handle(); for _ in 0..1000 { diff --git a/doc/src/adapt_io_example.rs b/doc/src/adapt_io_example.rs index 38d838a2..b6a9d4bd 100644 --- a/doc/src/adapt_io_example.rs +++ b/doc/src/adapt_io_example.rs @@ -11,7 +11,7 @@ fn main() -> std::io::Result<()> { // ANCHOR_END: decl_executor // ANCHOR: decl_loop - let mut event_loop = EventLoop::try_new()?; + let mut event_loop = EventLoop::new()?; let handle = event_loop.handle(); handle diff --git a/doc/src/async_example.rs b/doc/src/async_example.rs index da9097a2..2ff13092 100644 --- a/doc/src/async_example.rs +++ b/doc/src/async_example.rs @@ -11,7 +11,7 @@ fn main() -> std::io::Result<()> { // ANCHOR_END: decl_executor // ANCHOR: decl_loop - let mut event_loop = EventLoop::try_new()?; + let mut event_loop = EventLoop::new()?; let handle = event_loop.handle(); handle diff --git a/doc/src/timer_example.rs b/doc/src/timer_example.rs index f83d6bda..17f2af2b 100644 --- a/doc/src/timer_example.rs +++ b/doc/src/timer_example.rs @@ -7,7 +7,7 @@ use calloop::{ }; fn main() { - let mut event_loop = EventLoop::try_new().expect("Failed to initialize the event loop!"); + let mut event_loop = EventLoop::new().expect("Failed to initialize the event loop!"); // ANCHOR: decl_source let timer = Timer::from_duration(Duration::from_secs(5)); diff --git a/examples/high_precision.rs b/examples/high_precision.rs index b1bfbbb7..3e7a36f2 100644 --- a/examples/high_precision.rs +++ b/examples/high_precision.rs @@ -7,7 +7,7 @@ use calloop::{ fn main() { // As of calloop v0.11 there is no difference between low and high precision event loops. - let mut event_loop = EventLoop::try_new().expect("Failed to initialize the event loop!"); + let mut event_loop = EventLoop::new().expect("Failed to initialize the event loop!"); let before = Instant::now(); diff --git a/examples/timer.rs b/examples/timer.rs index 36f55500..89882f0e 100644 --- a/examples/timer.rs +++ b/examples/timer.rs @@ -11,7 +11,7 @@ fn main() { // just annotate the type here; the actual data is provided later in the // run() call. let mut event_loop: EventLoop = - EventLoop::try_new().expect("Failed to initialize the event loop!"); + EventLoop::new().expect("Failed to initialize the event loop!"); // Retrieve a handle. It is used to insert new sources into the event loop // It can be cloned, allowing you to insert sources from within source diff --git a/src/io.rs b/src/io.rs index 6157c191..6e049002 100644 --- a/src/io.rs +++ b/src/io.rs @@ -415,7 +415,7 @@ mod tests { #[test] fn read_write() { - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let (exec, sched) = executor().unwrap(); handle @@ -460,7 +460,7 @@ mod tests { #[test] fn read_write_vectored() { - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let (exec, sched) = executor().unwrap(); handle @@ -515,7 +515,7 @@ mod tests { fn readable() { use std::io::Write; - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let (exec, sched) = executor().unwrap(); handle @@ -554,7 +554,7 @@ mod tests { fn writable() { use std::io::{BufReader, BufWriter, Read, Write}; - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let (exec, sched) = executor().unwrap(); handle diff --git a/src/lib.rs b/src/lib.rs index ffb08a0a..6116257c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,7 +30,7 @@ //! // just annotate the type here; the actual data is provided later in the //! // run() call. //! let mut event_loop: EventLoop = -//! EventLoop::try_new().expect("Failed to initialize the event loop!"); +//! EventLoop::new().expect("Failed to initialize the event loop!"); //! //! // Retrieve a handle. It is used to insert new sources into the event loop //! // It can be cloned, allowing you to insert sources from within source diff --git a/src/loop_logic.rs b/src/loop_logic.rs index f6971baa..c71f90c7 100644 --- a/src/loop_logic.rs +++ b/src/loop_logic.rs @@ -379,7 +379,7 @@ impl<'l, Data> EventLoop<'l, Data> { /// Create a new event loop /// /// Fails if the initialization of the polling system failed. - pub fn try_new() -> crate::Result { + pub fn new() -> crate::Result { let poll = Poll::new()?; let poller = poll.poller.clone(); let handle = LoopHandle { @@ -842,7 +842,7 @@ mod tests { #[test] fn dispatch_idle() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -859,7 +859,7 @@ mod tests { #[test] fn cancel_idle() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -879,7 +879,7 @@ mod tests { #[test] fn wakeup() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let signal = event_loop.get_signal(); @@ -894,7 +894,7 @@ mod tests { #[test] fn wakeup_stop() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let signal = event_loop.get_signal(); @@ -910,7 +910,7 @@ mod tests { #[test] fn additional_events() { - let mut event_loop: EventLoop<'_, Lock> = EventLoop::try_new().unwrap(); + let mut event_loop: EventLoop<'_, Lock> = EventLoop::new().unwrap(); let mut lock = Lock { lock: Rc::new(( // Whether the lock is locked @@ -1045,7 +1045,7 @@ mod tests { fn default_additional_events() { let (sender, channel) = channel(); let mut test_source = NoopWithDefaultHandlers { channel }; - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); event_loop .handle() .insert_source(Box::new(&mut test_source), |_, _, _| {}) @@ -1103,7 +1103,7 @@ mod tests { #[test] fn additional_events_synthetic() { - let mut event_loop: EventLoop<'_, Lock> = EventLoop::try_new().unwrap(); + let mut event_loop: EventLoop<'_, Lock> = EventLoop::new().unwrap(); let mut lock = Lock { lock: Rc::new(Cell::new(false)), }; @@ -1212,7 +1212,7 @@ mod tests { } } - let event_loop = EventLoop::<()>::try_new().unwrap(); + let event_loop = EventLoop::<()>::new().unwrap(); let fd = LeakedFd(ManuallyDrop::new(unsafe { std::os::unix::io::OwnedFd::from_raw_fd(420) })); @@ -1227,7 +1227,7 @@ mod tests { fn invalid_token() { let (_ping, source) = crate::sources::ping::make_ping().unwrap(); - let event_loop = EventLoop::<()>::try_new().unwrap(); + let event_loop = EventLoop::<()>::new().unwrap(); let handle = event_loop.handle(); let reg_token = handle.insert_source(source, |_, _, _| {}).unwrap(); handle.remove(reg_token); @@ -1247,7 +1247,7 @@ mod tests { let source = crate::sources::generic::Generic::new(read, Interest::EMPTY, Mode::Level); let dispatcher = Dispatcher::new(source, |_, _, _| Ok(PostAction::Continue)); - let event_loop = EventLoop::<()>::try_new().unwrap(); + let event_loop = EventLoop::<()>::new().unwrap(); let handle = event_loop.handle(); let ret = handle.register_dispatcher(dispatcher.clone()); @@ -1262,7 +1262,7 @@ mod tests { #[test] fn disarm_rearm() { - let mut event_loop = EventLoop::::try_new().unwrap(); + let mut event_loop = EventLoop::::new().unwrap(); let (ping, ping_source) = make_ping().unwrap(); let ping_token = event_loop @@ -1353,7 +1353,7 @@ mod tests { } } - let mut event_loop = EventLoop::::try_new().unwrap(); + let mut event_loop = EventLoop::::new().unwrap(); let (ping1, source1) = make_ping().unwrap(); let (ping2, source2) = make_ping().unwrap(); @@ -1399,7 +1399,7 @@ mod tests { fn change_interests() { use rustix::io::write; use rustix::net::{recv, socketpair, AddressFamily, RecvFlags, SocketFlags, SocketType}; - let mut event_loop = EventLoop::::try_new().unwrap(); + let mut event_loop = EventLoop::::new().unwrap(); let (sock1, sock2) = socketpair( AddressFamily::UNIX, @@ -1485,7 +1485,7 @@ mod tests { #[test] fn kill_source() { - let mut event_loop = EventLoop::>::try_new().unwrap(); + let mut event_loop = EventLoop::>::new().unwrap(); let handle = event_loop.handle(); let (ping, ping_source) = make_ping().unwrap(); @@ -1517,7 +1517,7 @@ mod tests { struct RefSender<'a>(&'a mpsc::Sender<()>); let mut ref_sender = RefSender(&sender); - let mut event_loop = EventLoop::>::try_new().unwrap(); + let mut event_loop = EventLoop::>::new().unwrap(); let (ping, ping_source) = make_ping().unwrap(); let _ping_token = event_loop .handle() @@ -1544,7 +1544,7 @@ mod tests { use crate::sources::timer::TimeoutFuture; use std::time::Duration; - let mut evl = EventLoop::<()>::try_new().unwrap(); + let mut evl = EventLoop::<()>::new().unwrap(); let mut data = 22; let timeout = { @@ -1569,7 +1569,7 @@ mod tests { use crate::sources::timer; use std::time::Duration; - let mut evl = EventLoop::<()>::try_new().unwrap(); + let mut evl = EventLoop::<()>::new().unwrap(); let mut data = 22; let timeout = { @@ -1604,7 +1604,7 @@ mod tests { use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; - let mut evl = EventLoop::::try_new().unwrap(); + let mut evl = EventLoop::::new().unwrap(); let handle = evl.handle(); let data = Arc::new(Mutex::new(1)); @@ -1695,7 +1695,7 @@ mod tests { } // Now the actual test - let mut evl = EventLoop::::try_new().unwrap(); + let mut evl = EventLoop::::new().unwrap(); evl.handle() .insert_source(WithSubSource { token: None }, |_, _, ran| { *ran = true; @@ -1746,7 +1746,7 @@ mod tests { #[test] fn weak_loop_handle() { - let mut event_loop: EventLoop<()> = EventLoop::try_new().unwrap(); + let mut event_loop: EventLoop<()> = EventLoop::new().unwrap(); let weak_handle1 = event_loop.handle().downgrade(); let weak_handle2 = weak_handle1.clone(); let weak_handle3 = weak_handle1.clone(); diff --git a/src/macros.rs b/src/macros.rs index 2ae5317c..6f78b39b 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -173,7 +173,7 @@ mod tests { ping2, }; - let mut event_loop = crate::EventLoop::<[bool; 3]>::try_new().unwrap(); + let mut event_loop = crate::EventLoop::<[bool; 3]>::new().unwrap(); let handle = event_loop.handle(); let token = handle diff --git a/src/sources/channel.rs b/src/sources/channel.rs index 49f439ea..1d190456 100644 --- a/src/sources/channel.rs +++ b/src/sources/channel.rs @@ -287,7 +287,7 @@ mod tests { #[test] fn basic_channel() { - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); @@ -333,7 +333,7 @@ mod tests { #[test] fn basic_sync_channel() { - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); @@ -391,7 +391,7 @@ mod tests { #[test] fn test_more_than_1024() { - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let (tx, rx) = channel::<()>(); diff --git a/src/sources/futures.rs b/src/sources/futures.rs index 553f131f..b82314ee 100644 --- a/src/sources/futures.rs +++ b/src/sources/futures.rs @@ -418,7 +418,7 @@ mod tests { #[test] fn ready() { - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let handle = event_loop.handle(); @@ -453,7 +453,7 @@ mod tests { #[test] fn more_than_1024() { - let mut event_loop = crate::EventLoop::<()>::try_new().unwrap(); + let mut event_loop = crate::EventLoop::<()>::new().unwrap(); let handle = event_loop.handle(); let (exec, sched) = executor::<()>().unwrap(); diff --git a/src/sources/generic.rs b/src/sources/generic.rs index 9f98fead..2ad65f73 100644 --- a/src/sources/generic.rs +++ b/src/sources/generic.rs @@ -13,7 +13,7 @@ //! use calloop::{generic::Generic, Interest, Mode, PostAction}; //! //! # fn main() { -//! # let mut event_loop = calloop::EventLoop::<()>::try_new() +//! # let mut event_loop = calloop::EventLoop::<()>::new() //! # .expect("Failed to initialize the event loop!"); //! # let handle = event_loop.handle(); //! # #[cfg(unix)] @@ -350,7 +350,7 @@ mod tests { fn dispatch_unix() { use std::os::unix::net::UnixStream; - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); @@ -396,7 +396,7 @@ mod tests { fn register_deregister_unix() { use std::os::unix::net::UnixStream; - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); @@ -466,7 +466,7 @@ mod tests { io::{AsFd, BorrowedFd}, net::UnixStream, }; - let event_loop = crate::EventLoop::<()>::try_new().unwrap(); + let event_loop = crate::EventLoop::<()>::new().unwrap(); let handle = event_loop.handle(); diff --git a/src/sources/mod.rs b/src/sources/mod.rs index 489d8084..b260dc5f 100644 --- a/src/sources/mod.rs +++ b/src/sources/mod.rs @@ -613,7 +613,7 @@ mod tests { let (pinger, source) = make_ping().unwrap(); let boxed = Box::new(source); - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let handle = event_loop.handle(); let token = handle @@ -657,7 +657,7 @@ mod tests { let (pinger, mut source) = make_ping().unwrap(); let source_ref = &mut source; - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let handle = event_loop.handle(); let token = handle diff --git a/src/sources/ping.rs b/src/sources/ping.rs index aa3d1eb3..1ab05dba 100644 --- a/src/sources/ping.rs +++ b/src/sources/ping.rs @@ -84,7 +84,7 @@ mod tests { #[test] fn ping() { - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let (ping, source) = make_ping().unwrap(); @@ -111,7 +111,7 @@ mod tests { #[test] fn ping_closed() { - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let (_, source) = make_ping().unwrap(); event_loop @@ -141,7 +141,7 @@ mod tests { // This keeps track of whether the event fired. let mut dispatched = false; - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let (sender, source) = make_ping().unwrap(); let wrapper = TransientSource::from(source); @@ -186,7 +186,7 @@ mod tests { // This keeps track of whether the event fired. let mut dispatched = false; - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let (sender, source) = make_ping().unwrap(); let wrapper = TransientSource::from(source); @@ -232,7 +232,7 @@ mod tests { // This keeps track of whether the event fired. let mut dispatched = false; - let mut event_loop = crate::EventLoop::::try_new().unwrap(); + let mut event_loop = crate::EventLoop::::new().unwrap(); let (sender0, source) = make_ping().unwrap(); let wrapper = TransientSource::from(source); diff --git a/src/sources/timer.rs b/src/sources/timer.rs index b6331c9d..01724c94 100644 --- a/src/sources/timer.rs +++ b/src/sources/timer.rs @@ -383,7 +383,7 @@ mod tests { #[test] fn simple_timer() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -413,7 +413,7 @@ mod tests { #[test] fn simple_timer_instant() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -437,7 +437,7 @@ mod tests { #[test] fn immediate_timer() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -461,7 +461,7 @@ mod tests { // even if we cannot test if they are actually high precision #[test] fn high_precision_timer() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -497,7 +497,7 @@ mod tests { #[test] fn cancel_timer() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = false; @@ -529,7 +529,7 @@ mod tests { #[test] fn repeating_timer() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = 0; @@ -568,7 +568,7 @@ mod tests { #[cfg(feature = "executor")] #[test] fn timeout_future() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = 0; @@ -621,7 +621,7 @@ mod tests { #[test] fn no_overflow() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut dispatched = 0; diff --git a/src/sources/transient.rs b/src/sources/transient.rs index 107af756..bf6e9312 100644 --- a/src/sources/transient.rs +++ b/src/sources/transient.rs @@ -453,7 +453,7 @@ mod tests { // The TransientSource wrapper. let outer: TransientSource<_> = inner.into(); - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let _token = handle @@ -489,7 +489,7 @@ mod tests { let (sender, receiver) = channel(); let outer: TransientSource<_> = receiver.into(); - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); // Our callback puts the receied events in here for us to check later. @@ -644,7 +644,7 @@ mod tests { *test_id = got_id; }); - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let token = handle.register_dispatcher(dispatcher.clone()).unwrap(); @@ -740,7 +740,7 @@ mod tests { // The TransientSource wrapper. let outer: TransientSource<_> = inner.into(); - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let token = handle .insert_source(outer, |_, _, fired| { @@ -979,7 +979,7 @@ mod tests { // Now the actual test starts. let mut event_loop: crate::EventLoop<(Option, crate::LoopSignal)> = - crate::EventLoop::try_new().unwrap(); + crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); let signal = event_loop.get_signal(); @@ -1104,7 +1104,7 @@ mod tests { inner: receiver.into(), }; - let mut event_loop = crate::EventLoop::try_new().unwrap(); + let mut event_loop = crate::EventLoop::new().unwrap(); let handle = event_loop.handle(); handle diff --git a/tests/signals.rs b/tests/signals.rs index a145a11b..ce700e6f 100644 --- a/tests/signals.rs +++ b/tests/signals.rs @@ -33,7 +33,7 @@ mod test { } fn single_usr1() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut signal_received = false; @@ -59,7 +59,7 @@ mod test { } fn usr2_added_afterwards() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut signal_received = None; let dispatcher = Dispatcher::new( @@ -89,7 +89,7 @@ mod test { } fn usr2_signal_removed() { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::new().unwrap(); let mut signal_received = None; let dispatcher = Dispatcher::new(