mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-02-23 15:49:54 +01:00
Fix warnings in README's example
This commit is contained in:
committed by
Tim
parent
dd63fb59bf
commit
3264979993
10
README.md
10
README.md
@@ -93,14 +93,10 @@ For a more real-world example, see [example-service](example-service).
|
||||
First, let's set up the dependencies and service definition.
|
||||
|
||||
```rust
|
||||
|
||||
use futures::{
|
||||
future::{self, Ready},
|
||||
prelude::*,
|
||||
};
|
||||
use futures::future::{self, Ready};
|
||||
use tarpc::{
|
||||
client, context,
|
||||
server::{self, incoming::Incoming, Channel},
|
||||
server::{self, Channel},
|
||||
};
|
||||
|
||||
// This is the service definition. It looks a lot like a trait definition.
|
||||
@@ -148,7 +144,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
// WorldClient is generated by the #[tarpc::service] attribute. It has a constructor `new`
|
||||
// that takes a config and any Transport as input.
|
||||
let mut client = WorldClient::new(client::Config::default(), client_transport).spawn();
|
||||
let client = WorldClient::new(client::Config::default(), client_transport).spawn();
|
||||
|
||||
// The client has an RPC method for each RPC defined in the annotated trait. It takes the same
|
||||
// args as defined, with the addition of a Context, which is always the first arg. The Context
|
||||
|
||||
Reference in New Issue
Block a user