aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/errors.rs
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2025-03-23 10:03:42 +0000
committerGitHub <noreply@github.com>2025-03-23 10:03:42 +0000
commit6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34 (patch)
tree5df14ebd014407f087cb8b5d46c4f0f44a5b3908 /zellij-utils/src/errors.rs
parentbuild: Don't use default features (#4086) (diff)
downloadsl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.tar.gz
sl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.tar.xz
sl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.zip
build: Don't re-export foreign crates in utils (#4087)
* build(utils): Don't use reexported dependency for internal code, but use the dependency directly. * build(client): Don't use re-exports from `utils` but turn `zellij-utils` dependencies into shared workspace dependencies instead and specify those in `Cargo.toml` explicitly. This gives a much better overview of what component in zellij uses which crates. The previous approach hides a lot of this information since it looks like crates are used in a single place where this isn't actually true. * deps(tile): Don't use re-exports from zellij-utils. * build(zellij): Don't use re-exports from zellij-utils. * build(server): Don't use re-exports from zellij-utils. * build(utils): Don't re-export foreign crates. * docs: Update Changelog with PR #4087. * style: Apply rustfmt. * style: Apply rustfmt. * build(e2e): Don't use re-export from zellij-utils. * test: Restore e2e tests. * style: Apply more formatting.
Diffstat (limited to 'zellij-utils/src/errors.rs')
-rw-r--r--zellij-utils/src/errors.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/zellij-utils/src/errors.rs b/zellij-utils/src/errors.rs
index 9c419773..7c5ccc6d 100644
--- a/zellij-utils/src/errors.rs
+++ b/zellij-utils/src/errors.rs
@@ -785,7 +785,7 @@ mod not_wasm {
/// Helper trait to convert error types that don't satisfy `anyhow`s trait requirements to
/// anyhow errors.
pub trait ToAnyhow<U> {
- fn to_anyhow(self) -> crate::anyhow::Result<U>;
+ fn to_anyhow(self) -> anyhow::Result<U>;
}
/// `SendError` doesn't satisfy `anyhow`s trait requirements due to `T` possibly being a
@@ -798,19 +798,19 @@ mod not_wasm {
impl<T: std::fmt::Debug, U> ToAnyhow<U>
for Result<U, crate::channels::SendError<(T, ErrorContext)>>
{
- fn to_anyhow(self) -> crate::anyhow::Result<U> {
+ fn to_anyhow(self) -> anyhow::Result<U> {
match self {
- Ok(val) => crate::anyhow::Ok(val),
+ Ok(val) => anyhow::Ok(val),
Err(e) => {
let (msg, context) = e.into_inner();
if *crate::consts::DEBUG_MODE.get().unwrap_or(&true) {
- Err(crate::anyhow::anyhow!(
+ Err(anyhow::anyhow!(
"failed to send message to channel: {:#?}",
msg
))
.with_context(|| context.to_string())
} else {
- Err(crate::anyhow::anyhow!("failed to send message to channel"))
+ Err(anyhow::anyhow!("failed to send message to channel"))
.with_context(|| context.to_string())
}
},
@@ -819,16 +819,14 @@ mod not_wasm {
}
impl<U> ToAnyhow<U> for Result<U, std::sync::PoisonError<U>> {
- fn to_anyhow(self) -> crate::anyhow::Result<U> {
+ fn to_anyhow(self) -> anyhow::Result<U> {
match self {
- Ok(val) => crate::anyhow::Ok(val),
+ Ok(val) => anyhow::Ok(val),
Err(e) => {
if *crate::consts::DEBUG_MODE.get().unwrap_or(&true) {
- Err(crate::anyhow::anyhow!(
- "cannot acquire poisoned lock for {e:#?}"
- ))
+ Err(anyhow::anyhow!("cannot acquire poisoned lock for {e:#?}"))
} else {
- Err(crate::anyhow::anyhow!("cannot acquire poisoned lock"))
+ Err(anyhow::anyhow!("cannot acquire poisoned lock"))
}
},
}