A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/lsp/rq.rs')
-rw-r--r--src/lsp/rq.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lsp/rq.rs b/src/lsp/rq.rs
index 1d7ef09..ef1316f 100644
--- a/src/lsp/rq.rs
+++ b/src/lsp/rq.rs
@@ -99,14 +99,15 @@ impl<const R: &'static str> Display for Unsupported<R> {
write!(f, "request {} isnt supported by this LSP", R)
}
}
-pub trait Peel<E> {
- fn peel(self) -> Result<(), E>;
+pub trait Peel<E, T> {
+ fn peel(self) -> Result<Option<T>, E>;
}
-impl<E, N> Peel<E> for Result<Result<(), E>, N> {
- fn peel(self) -> Result<(), E> {
+impl<E, N, T> Peel<E, T> for Result<Result<T, E>, N> {
+ fn peel(self) -> Result<Option<T>, E> {
match self {
Ok(Err(e)) => Err(e),
- Ok(Ok(_)) | Err(_) => Ok(()),
+ Ok(Ok(x)) => Ok(Some(x)),
+ Err(_) => Ok(None),
}
}
}