Added Wayland support

This commit is contained in:
David Johnson 2022-01-19 21:11:20 -06:00
parent d4dea5a95f
commit d8087a68a0
5 changed files with 85 additions and 2 deletions

View file

@ -15,3 +15,10 @@ pub enum SoftBufferError<W: HasRawWindowHandle> {
#[error("Platform error")]
PlatformError(Option<String>, Option<Box<dyn Error>>)
}
pub(crate) fn unwrap<T, E: std::error::Error + 'static, W: HasRawWindowHandle>(res: Result<T, E>, str: &str) -> Result<T, SoftBufferError<W>>{
match res{
Ok(t) => Ok(t),
Err(e) => Err(SoftBufferError::PlatformError(Some(str.into()), Some(Box::new(e))))
}
}