Fix warnings in README's example

This commit is contained in:
Guillaume Charmetant
2023-09-11 11:02:24 +02:00
committed by Tim
parent dd63fb59bf
commit 3264979993

View File

@@ -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