From 05af820036381313d7ab4c6bd9ae066b1272367e Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Mon, 30 Sep 2019 15:28:23 -0400 Subject: [PATCH] Fix for rust-lang/rust#64477 `foo(format!(...)).await` no longer compiles. There's a fix in rust-lang/rust#64856, but this works around the problem. --- tokio-fs/examples/std-echo.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tokio-fs/examples/std-echo.rs b/tokio-fs/examples/std-echo.rs index 3b0086b9dae..311f1248a48 100644 --- a/tokio-fs/examples/std-echo.rs +++ b/tokio-fs/examples/std-echo.rs @@ -19,8 +19,11 @@ async fn main() -> Result<(), Box> { while let Some(line) = input.next().await { let line = line?; - output.send(format!("OUT: {}", line)).await?; - error.send(format!("ERR: {}", line)).await?; + // https://github.com/rust-lang/rust/pull/64856 + let s = format!("OUT: {}", line); + output.send(s).await?; + let s = format!("ERR: {}", line); + error.send(s).await?; } Ok(()) }