From 697d42a64f89e7c8e142d6f444eaa2dde3eb421b Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 26 Mar 2015 19:07:59 +0100 Subject: choose_pixel_format now returns a Result --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 7f404c3..aba6752 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -304,7 +304,7 @@ impl<'a> BuilderAttribs<'a> { (new_attribs, sharing) } - fn choose_pixel_format(&self, iter: I) -> (T, PixelFormat) + fn choose_pixel_format(&self, iter: I) -> Result<(T, PixelFormat), CreationError> where I: Iterator, T: Clone { let mut current_result = None; @@ -343,7 +343,7 @@ impl<'a> BuilderAttribs<'a> { } current_result.or(current_software_result) - .expect("Could not find compliant pixel format") + .ok_or(CreationError::NotSupported) } } -- cgit v1.2.3