Remove EventLoopError::AlreadyRunning

This is already prevented by the type-system, and as such it doesn't
make sense to have an error case for this.
This commit is contained in:
Mads Marquart authored and GitHub committed 2024-01-29 22:06:03 +04:00
1 parent f204467838
commit f526a47152
9 files changed
+15 -29

No files matched your search

-5
View File
@@ -94,8 +94,6 @@ use crate::{
};
use runner::{EventLoopRunner, EventLoopRunnerShared};
use self::runner::RunnerState;
use super::{window::set_skip_taskbar, SelectedCursor};
/// some backends like macos uses an uninhabited `Never` type,
@@ -246,9 +244,6 @@ impl<T: 'static> EventLoop<T> {
{
{
let runner = &self.window_target.p.runner_shared;
if runner.state() != RunnerState::Uninitialized {
return Err(EventLoopError::AlreadyRunning);
}
let event_loop_windows_ref = &self.window_target;
let user_event_receiver = &self.user_event_receiver;
@@ -143,10 +143,6 @@ impl<T> EventLoopRunner<T> {
}
}
pub fn state(&self) -> RunnerState {
self.runner_state.get()
}
pub fn set_control_flow(&self, control_flow: ControlFlow) {
self.control_flow.set(control_flow)
}