From 7f6dce43829b915cbaa5d49625506fd060e2c6d6 Mon Sep 17 00:00:00 2001 From: EFanZh Date: Tue, 23 Dec 2025 12:41:42 +0800 Subject: [PATCH] Constify `fmt::from_fn` --- library/core/src/fmt/builders.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/fmt/builders.rs b/library/core/src/fmt/builders.rs index 197cddd3fa9de..1a7db8719b404 100644 --- a/library/core/src/fmt/builders.rs +++ b/library/core/src/fmt/builders.rs @@ -1228,7 +1228,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> { /// ``` #[stable(feature = "fmt_from_fn", since = "1.93.0")] #[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"] -pub fn from_fn) -> fmt::Result>(f: F) -> FromFn { +pub const fn from_fn) -> fmt::Result>(f: F) -> FromFn { FromFn(f) }