mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-01 17:14:32 +01:00
Change FutureService's associated types to be bounded by IntoFuture rather than Future.
It's strictly more flexible, because everything that impls Future impls IntoFuture, and it additionally allows returning types like Result. Which is nice.
This commit is contained in:
@@ -40,10 +40,10 @@ pub mod double {
|
||||
struct AddServer;
|
||||
|
||||
impl AddFutureService for AddServer {
|
||||
type AddFut = futures::Finished<i32, Never>;
|
||||
type AddFut = Result<i32, Never>;
|
||||
|
||||
fn add(&self, x: i32, y: i32) -> Self::AddFut {
|
||||
futures::finished(x + y)
|
||||
Ok(x + y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user