struct Foo<T>(T); impl<T> IntoFuture for Foo<T> { type Item = T; type Error = SomeError; type Future = FutureResult<T, SomError>; fn into_future(self) -> Self::Future { Ok(self.0).into_future() } }
T が IntoFuture<Item = T, Error = SomeError> 実装していると楽なのになーと一瞬思ったが適当にラップして返せばよいことに気づいた 〜完〜
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.