29 lines · 830 B · Rust
RawDownload
// Allow tide Results to accept context like other Results do when// using anyhow.pub trait TideResultExt {    fn context<C>(self, cx: C) -> Self    where        C: std::fmt::Display + Send + Sync + 'static;     fn with_context<C, F>(self, f: F) -> Self    where        C: std::fmt::Display + Send + Sync + 'static,        F: FnOnce() -> C;} impl<T> TideResultExt for tide::Result<T> {    fn context<C>(self, cx: C) -> Self    where        C: std::fmt::Display + Send + Sync + 'static,    {        self.map_err(|e| tide::Error::new(e.status(), e.into_inner().context(cx)))    }     fn with_context<C, F>(self, f: F) -> Self    where        C: std::fmt::Display + Send + Sync + 'static,        F: FnOnce() -> C,    {        self.map_err(|e| tide::Error::new(e.status(), e.into_inner().context(f())))    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t