rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.88k stars 911 forks source link

Some statements can be simplified for readability #4000

Closed hamirmahal closed 3 days ago

hamirmahal commented 5 days ago

We can simplify some statements like so to improve code readability and maintainability.

            X11Error::Xlib(e) => write!(f, "Xlib error: {e}"),
            X11Error::Connect(e) => write!(f, "X11 connection error: {e}"),
            X11Error::Connection(e) => write!(f, "X11 connection error: {e}"),
            X11Error::XidsExhausted(e) => write!(f, "XID range exhausted: {e}"),
            X11Error::GetProperty(e) => write!(f, "Failed to get X property {e}"),
            X11Error::X11(e) => write!(f, "X11 error: {e:?}"),
            X11Error::UnexpectedNull(s) => write!(f, "Xlib function returned null: {s}"),