Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ license-file = "LICENSE"
readme = "README.md"

[workspace.dependencies]
clap = { version = "4.5.23", features = ["derive"] }
clap = { version = "4.6.6", features = ["derive"] }
libmars = { path = "./libmars", version = "0.6.1" }
serde = { version = "1.0.216", features = ["derive"] }
serde_norway = { version = "0.9.41" }
serde = { version = "1.0.229", features = ["derive"] }
yaml_serde = { version = "0.10.7" }
x11 = { version = "2.21.0", features = ["xlib"] }


Expand Down
4 changes: 2 additions & 2 deletions libmars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ readme.workspace = true

[dependencies]
serde = { workspace = true, features = ["derive"], optional = true }
serde_norway = { workspace = true, optional = true }
yaml_serde = { workspace = true, optional = true }
x11 = { workspace = true, features = ["xinerama", "xrandr", "xft"] }
xdg = { version = "3.0.0", optional = true }

[features]
configuration = ["dep:serde", "dep:serde_norway", "dep:xdg"]
configuration = ["dep:serde", "dep:yaml_serde", "dep:xdg"]
xlib = [] # TODO implement configuration option

13 changes: 6 additions & 7 deletions libmars/src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use crate::platforms::x11::misc::atoms::X11Atom;

pub type Result<T> = CoreResult<T, MarsError>;

#[derive(Debug,Clone)]
#[derive(Debug, Clone)]
pub struct MarsError {
kind: MarsErrorKind,
info: Option<String>,
}

#[derive(Debug,Copy,Clone)]
#[derive(Debug, Copy, Clone)]
pub enum MarsErrorKind {
ConnectionFailed,
FailedRequest,
Expand All @@ -22,7 +22,6 @@ pub enum MarsErrorKind {
UnsupportedProtocol,
}


impl MarsError {
pub fn failed_request(call: &str) -> MarsError {
MarsError {
Expand All @@ -34,7 +33,10 @@ impl MarsError {
pub fn failed_conversion(value: impl std::fmt::Debug, from: &str, to: &str) -> MarsError {
MarsError {
kind: MarsErrorKind::IllegalValue,
info: Some(format!("unable to convert {:?} from {} to {}", value, from, to)),
info: Some(format!(
"unable to convert {:?} from {} to {}",
value, from, to
)),
}
}

Expand Down Expand Up @@ -81,7 +83,6 @@ impl MarsError {
}
}


impl Display for MarsError {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
self.kind.fmt(f)?;
Expand Down Expand Up @@ -112,5 +113,3 @@ impl Display for MarsErrorKind {
write!(f, "{}", name)
}
}


Loading