mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Spans are more powerful, and can even optionally be emitted as events by using `.with_span_events(tracing_subscriber::fmt::format::FmtSpan::*)`.
12 lines
351 B
Rust
12 lines
351 B
Rust
use objc2_core_graphics::CGError;
|
|
use winit_core::error::OsError;
|
|
|
|
macro_rules! os_error {
|
|
($error:expr) => {{ winit_core::error::OsError::new(line!(), file!(), $error) }};
|
|
}
|
|
|
|
#[track_caller]
|
|
pub(crate) fn cgerr(err: CGError) -> Result<(), OsError> {
|
|
if err == CGError::Success { Ok(()) } else { Err(os_error!(format!("CGError {err:?}"))) }
|
|
}
|