summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/phosphor.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/phosphor.rs b/src/phosphor.rs
index 122f36f..22f9de5 100644
--- a/src/phosphor.rs
+++ b/src/phosphor.rs
@@ -19,12 +19,10 @@ pub struct Phosphor {
}
impl Phosphor {
- pub fn new() -> Result<Self, ()> {
- if let Ok(event_loop) = EventLoop::new() {
+ pub fn new() -> Result<Self, EventLoopError> {
+ EventLoop::new().and_then(|event_loop| {
Ok( Self { event_loop, builders: Vec::new() } )
- } else {
- Err(())
- }
+ })
}
pub fn add_window(&mut self, window: WindowBuilder) {