Fix for rust-lang/rust#64477 (#1618)

`foo(format!(...)).await` no longer compiles. There's a fix in
rust-lang/rust#64856, but this works around the problem.
This commit is contained in:
Jon Gjengset 2019-09-30 17:17:14 -04:00 committed by GitHub
parent 5fd5329497
commit 5ce5a0a0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,8 +19,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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(())
}