Implement Error trait for KeyboardError using thiserror
This commit is contained in:
parent
87acba51f8
commit
a774d8c52e
|
@ -8,6 +8,7 @@ use std::{
|
||||||
rc::Rc,
|
rc::Rc,
|
||||||
};
|
};
|
||||||
use tempfile::tempfile;
|
use tempfile::tempfile;
|
||||||
|
use thiserror::Error;
|
||||||
use wayland_server::{
|
use wayland_server::{
|
||||||
protocol::{
|
protocol::{
|
||||||
wl_keyboard::{KeyState as WlKeyState, KeymapFormat, Request, WlKeyboard},
|
wl_keyboard::{KeyState as WlKeyState, KeymapFormat, Request, WlKeyboard},
|
||||||
|
@ -220,11 +221,13 @@ impl KbdInternal {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors that can be encountered when creating a keyboard handler
|
/// Errors that can be encountered when creating a keyboard handler
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// libxkbcommon could not load the specified keymap
|
/// libxkbcommon could not load the specified keymap
|
||||||
|
#[error("Libxkbcommon could not load the specified keymap")]
|
||||||
BadKeymap,
|
BadKeymap,
|
||||||
/// Smithay could not create a tempfile to share the keymap with clients
|
/// Smithay could not create a tempfile to share the keymap with clients
|
||||||
|
#[error("Failed to create tempfile to share the keymap: {0}")]
|
||||||
IoError(IoError),
|
IoError(IoError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue