From ddea357de2cd7888578203404393d558c368ddd0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 4 Oct 2019 14:12:21 +0200 Subject: [PATCH] work around a compiler bug Signed-off-by: Wolfgang Bumiller --- api-test/src/bin/api-test.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api-test/src/bin/api-test.rs b/api-test/src/bin/api-test.rs index be5544ed..96ec219f 100644 --- a/api-test/src/bin/api-test.rs +++ b/api-test/src/bin/api-test.rs @@ -110,7 +110,9 @@ async fn get_www(path: String) -> Result, Error> { } // FIXME: Add support for an ApiError type for 404s etc. to reduce error handling code size: - let mut file = match tokio::fs::File::open(format!("{}/{}", www_dir(), path)).await { + // Compiler bug: cannot use format!() in await expressions... + let file_path = format!("{}/{}", www_dir(), path); + let mut file = match tokio::fs::File::open(&file_path).await { Ok(file) => file, Err(ref err) if err.kind() == io::ErrorKind::NotFound => { return Ok(http::Response::builder()