aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-03-26 19:07:59 +0100
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-03-28 20:17:30 +0100
commit697d42a64f89e7c8e142d6f444eaa2dde3eb421b (patch)
tree64cffb1cbda7e605e5b0c3f4b9c7054e2c8d82d4 /src/lib.rs
parentd7c44b95b04fa3ea25a5e5943148583c862ab025 (diff)
downloadglutin-697d42a64f89e7c8e142d6f444eaa2dde3eb421b.tar.gz
glutin-697d42a64f89e7c8e142d6f444eaa2dde3eb421b.zip
choose_pixel_format now returns a Result
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
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<T, I>(&self, iter: I) -> (T, PixelFormat)
+ fn choose_pixel_format<T, I>(&self, iter: I) -> Result<(T, PixelFormat), CreationError>
where I: Iterator<Item=(T, PixelFormat)>, 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)
}
}