From 25140a26f11e5c3edaa76b239961a46d0b745a75 Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Sun, 26 Feb 2023 15:03:40 +0100 Subject: [PATCH] Use `const fn` consistently before `?const fn` is introduced --- .../2023-02-23-keyword-generics-progress-report-feb-2023.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posts/inside-rust/2023-02-23-keyword-generics-progress-report-feb-2023.md b/posts/inside-rust/2023-02-23-keyword-generics-progress-report-feb-2023.md index ddf3e9810..b1a7bb6cf 100644 --- a/posts/inside-rust/2023-02-23-keyword-generics-progress-report-feb-2023.md +++ b/posts/inside-rust/2023-02-23-keyword-generics-progress-report-feb-2023.md @@ -183,7 +183,7 @@ trait ?const ?async Read { } /// Read from a reader into a string. -?const ?async fn read_to_string(reader: &mut impl ?const ?async Read) -> io::Result { +const ?async fn read_to_string(reader: &mut impl ?const ?async Read) -> io::Result { let mut string = String::new(); reader.read_to_string(&mut string).await?; Ok(string) @@ -192,7 +192,7 @@ trait ?const ?async Read { That's sure starting to feel like a lot of keywords, right? We've accurately described exactly what's going on, but there's a lot of repetition. We know that -if we're dealing with a `?const ?async fn`, most arguments probably will also +if we're dealing with a `const ?async fn`, most arguments probably will want to be `?const ?async`. But under the syntax rules we've proposed so far, you'd end up repeating that everywhere. And it probably gets worse once we start adding in more keywords. Not ideal!