From 86c924ff3e541cb01ae08e780d0e8ab070565332 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 14 Apr 2024 13:52:58 +0100 Subject: [PATCH] fmt-debug option Allows disabling `fmt::Debug` derive and debug formatting. --- core/src/fmt/rt.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/fmt/rt.rs b/core/src/fmt/rt.rs index 65a4d537cc74d..f29ac99b29255 100644 --- a/core/src/fmt/rt.rs +++ b/core/src/fmt/rt.rs @@ -118,6 +118,10 @@ impl<'a> Argument<'a> { Self::new(x, Debug::fmt) } #[inline(always)] + pub fn new_debug_noop<'b, T: Debug>(x: &'b T) -> Argument<'_> { + Self::new(x, |_, _| Ok(())) + } + #[inline(always)] pub fn new_octal<'b, T: Octal>(x: &'b T) -> Argument<'_> { Self::new(x, Octal::fmt) }