fix(graphics-server): convert "never" types

Fixes build failure due to a type mismatch between `Never` and `!`
in `claim_main_thread`.
This commit is contained in:
yvt 2023-04-28 01:23:49 +09:00
parent 0522cf9c93
commit 8504b6fc6b

View file

@ -17,7 +17,8 @@ pub enum Never {}
#[inline]
pub fn claim_main_thread(f: impl FnOnce(MainThreadToken) -> Never + Send + 'static) -> ! {
// Just call the closure - this backend will work on any thread
f(MainThreadToken(()))
#[allow(unreachable_code)] // false positive
match f(MainThreadToken(())) {}
}
pub struct XousDisplay {