chore(tutorials): Add .await after client connect call (#109)
Both tutorials were missing .await on the client connect call, causing the compiler to issue errors. Thanks for alce#6260 on the #tonic-users discord channel for providing the answer.
This commit is contained in:
@@ -291,7 +291,7 @@ use hello_world::{client::GreeterClient, HelloRequest};
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut client = GreeterClient::connect("http://[::1]:50051")?;
|
let mut client = GreeterClient::connect("http://[::1]:50051").await?;
|
||||||
|
|
||||||
let request = tonic::Request::new(HelloRequest {
|
let request = tonic::Request::new(HelloRequest {
|
||||||
name: "Tonic".into(),
|
name: "Tonic".into(),
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ use route_guide::{client::RouteGuideClient, Point, Rectangle, RouteNote};
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut client = RouteGuideClient::connect("http://[::1]:10000")?;
|
let mut client = RouteGuideClient::connect("http://[::1]:10000").await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user