diff --git a/crates/komorebi-core/src/workspace.rs b/crates/komorebi-core/src/workspace.rs index 22a219b2..330f365a 100644 --- a/crates/komorebi-core/src/workspace.rs +++ b/crates/komorebi-core/src/workspace.rs @@ -201,12 +201,12 @@ pub trait WorkspacePlatform: Sized + Clone + std::fmt::Debug + PartialEq + 'stat /// Puts the monocle window on the work area it is given. fn place_monocle(_window: &mut Self::Window, _rect: &Rect) -> eyre::Result<()> { - Err(eyre::eyre!("this platform has no shared update")) + Err(eyre::Report::msg("this platform has no shared update")) } /// Lays the maximized window out: the platform's own maximize. fn maximize_in_layout(_window: &mut Self::Window) -> eyre::Result<()> { - Err(eyre::eyre!("this platform has no shared update")) + Err(eyre::Report::msg("this platform has no shared update")) } /// Whether the scrolling layout should learn the widths the windows really have before it is @@ -258,7 +258,7 @@ pub trait WorkspacePlatform: Sized + Clone + std::fmt::Debug + PartialEq + 'stat _hidden: bool, _placement: &Placement<'_>, ) -> eyre::Result<()> { - Err(eyre::eyre!("this platform has no shared update")) + Err(eyre::Report::msg("this platform has no shared update")) } /// Called after every placement pass; `Pass::Again` runs one more (the Windows scrolling layout diff --git a/crates/komorebi-core/tests/common/mod.rs b/crates/komorebi-core/tests/common/mod.rs index 040e2131..3ac451d1 100644 --- a/crates/komorebi-core/tests/common/mod.rs +++ b/crates/komorebi-core/tests/common/mod.rs @@ -152,7 +152,7 @@ fn fails(operation: &str) -> bool { fn op(line: String, key: String) -> eyre::Result<()> { push(line); if fails(&key) { - Err(eyre::eyre!("{key} failed")) + Err(eyre::Report::msg(format!("{key} failed"))) } else { Ok(()) } @@ -304,7 +304,7 @@ impl WorkspacePlatform for StubPlatform { fn begin_update(_: &mut Workspace) -> eyre::Result { push("begin_update".to_string()); if fails("begin_update") { - return Err(eyre::eyre!("begin_update failed")); + return Err(eyre::Report::msg("begin_update failed")); } if settings(|s| s.skip_update) { return Ok(Flow::Skip); @@ -414,7 +414,7 @@ impl WorkspacePlatform for StubPlatform { "end_update pass={pass} around={around_window} viewport={viewport_width}" )); if fails("end_update") { - return Err(eyre::eyre!("end_update failed")); + return Err(eyre::Report::msg("end_update failed")); } Ok(settings(|s| s.passes.pop()).unwrap_or(Pass::Done)) } diff --git a/crates/komorebi-linux/src/kwin/mod.rs b/crates/komorebi-linux/src/kwin/mod.rs index 6905e50b..ef58f54a 100644 --- a/crates/komorebi-linux/src/kwin/mod.rs +++ b/crates/komorebi-linux/src/kwin/mod.rs @@ -850,7 +850,7 @@ impl komorebi_backend::Backend for KWinBackend { fn monitors(&self) -> komorebi_backend::Result> { let monitors = self.shared.table.lock().monitors(); if monitors.is_empty() { - return Err(platform(eyre::eyre!("KWin reported no outputs"))); + return Err(platform(eyre::Report::msg("KWin reported no outputs"))); } Ok(monitors.into_iter().map(Into::into).collect()) } diff --git a/crates/komorebi-windows/src/animation/ghost.rs b/crates/komorebi-windows/src/animation/ghost.rs index d35714fb..5cc4ae2c 100644 --- a/crates/komorebi-windows/src/animation/ghost.rs +++ b/crates/komorebi-windows/src/animation/ghost.rs @@ -552,7 +552,9 @@ fn run_owner_loop(cmd_rx: crossbeam_channel::Receiver) { }) => { let result = match host.as_mut() { Some(host) => host.register(&snapshot, start_rect, clip), - None => Err(eyre::eyre!("the ghost host window could not be created")), + None => Err(eyre::Report::msg( + "the ghost host window could not be created", + )), }; let _ = reply.send(result); } @@ -687,7 +689,7 @@ impl GhostWindow { clip, reply: reply_tx, }) - .map_err(|e| eyre::eyre!("ghost owner channel send failed: {e}"))?; + .map_err(|e| eyre::Report::msg(format!("ghost owner channel send failed: {e}")))?; let Registered { hthumb, origin, @@ -789,7 +791,7 @@ impl GhostWindow { .send(GhostCmd::Destroy { hthumb: self.hthumb, }) - .map_err(|e| eyre::eyre!("ghost owner channel send failed: {e}")) + .map_err(|e| eyre::Report::msg(format!("ghost owner channel send failed: {e}"))) } } diff --git a/crates/komorebi-windows/src/animation/ghost_dispatcher.rs b/crates/komorebi-windows/src/animation/ghost_dispatcher.rs index d0023164..dceaaea3 100644 --- a/crates/komorebi-windows/src/animation/ghost_dispatcher.rs +++ b/crates/komorebi-windows/src/animation/ghost_dispatcher.rs @@ -414,9 +414,12 @@ impl GhostDispatcher { /// Wait for the resize started by `start_resize` to be done fn finish_resize(&self) -> eyre::Result<()> { match self.resize.lock().take() { - Some(resize) => resize - .join() - .unwrap_or_else(|_| Err(eyre::eyre!("the resize of hwnd {} panicked", self.hwnd))), + Some(resize) => resize.join().unwrap_or_else(|_| { + Err(eyre::Report::msg(format!( + "the resize of hwnd {} panicked", + self.hwnd + ))) + }), None => Ok(()), } } diff --git a/crates/komorebi-windows/src/animation/snapshot.rs b/crates/komorebi-windows/src/animation/snapshot.rs index e38df2c7..b596ce16 100644 --- a/crates/komorebi-windows/src/animation/snapshot.rs +++ b/crates/komorebi-windows/src/animation/snapshot.rs @@ -325,7 +325,9 @@ fn render(hwnd: isize) -> eyre::Result { if printed.as_bool() { Ok(rendered) } else { - Err(eyre::eyre!("hwnd {hwnd} would not render itself")) + Err(eyre::Report::msg(format!( + "hwnd {hwnd} would not render itself" + ))) } })(); diff --git a/crates/komorebi-windows/src/live_resize.rs b/crates/komorebi-windows/src/live_resize.rs index 66e54bf8..8b43b216 100644 --- a/crates/komorebi-windows/src/live_resize.rs +++ b/crates/komorebi-windows/src/live_resize.rs @@ -946,7 +946,7 @@ impl WindowManager { let _snapping = Snapping::new(true); self.focused_monitor_mut() - .ok_or_else(|| eyre::eyre!("there is no monitor")) + .ok_or_else(|| eyre::Report::msg("there is no monitor")) .and_then(|monitor| monitor.update_focused_workspace(monitor_offset)) } diff --git a/crates/komorebi-windows/src/monitor_reconciliator/mod.rs b/crates/komorebi-windows/src/monitor_reconciliator/mod.rs index 990a264f..72400079 100644 --- a/crates/komorebi-windows/src/monitor_reconciliator/mod.rs +++ b/crates/komorebi-windows/src/monitor_reconciliator/mod.rs @@ -155,8 +155,8 @@ where }; if !errors.is_empty() { - return Err(color_eyre::eyre::eyre!( - "could not successfully enumerate all displays" + return Err(color_eyre::eyre::Report::msg( + "could not successfully enumerate all displays", )); } diff --git a/komorebi-recorder/src/platform/linux/exclude.rs b/komorebi-recorder/src/platform/linux/exclude.rs index d28dfa27..0e268a5d 100644 --- a/komorebi-recorder/src/platform/linux/exclude.rs +++ b/komorebi-recorder/src/platform/linux/exclude.rs @@ -127,7 +127,8 @@ fn reconfigure() -> eyre::Result<()> { /// /// Returns an error when the file cannot be read or written, or KWin cannot be asked. pub fn ensure() -> eyre::Result<()> { - let path = rules_path().ok_or_else(|| eyre::eyre!("there is no configuration directory"))?; + let path = + rules_path().ok_or_else(|| eyre::Report::msg("there is no configuration directory"))?; let text = match std::fs::read_to_string(&path) { Ok(text) => text, Err(error) if error.kind() == std::io::ErrorKind::NotFound => String::new(), diff --git a/komorebi-recorder/src/viewer/app.rs b/komorebi-recorder/src/viewer/app.rs index 135d99b9..d9792671 100644 --- a/komorebi-recorder/src/viewer/app.rs +++ b/komorebi-recorder/src/viewer/app.rs @@ -671,7 +671,7 @@ impl ViewerApp { Ok(outcome) => outcome, Err(crossbeam_channel::TryRecvError::Empty) => continue, Err(crossbeam_channel::TryRecvError::Disconnected) => { - Err(eyre::eyre!("the thread reading the session stopped")) + Err(eyre::Report::msg("the thread reading the session stopped")) } }; self.tabs[index] = match outcome.and_then(|loaded| self.build_open(loaded)) {