From 624eb4fb256e7faa9cbce4e3ad11aa1c165ee5d0 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 18 Jun 2025 19:18:50 +0800 Subject: [PATCH] Remove Rust nightly API --- yazi-macro/src/fmt.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/yazi-macro/src/fmt.rs b/yazi-macro/src/fmt.rs index ad0c7ce8..cc12ba0d 100644 --- a/yazi-macro/src/fmt.rs +++ b/yazi-macro/src/fmt.rs @@ -3,15 +3,7 @@ macro_rules! try_format { ($($arg:tt)*) => {{ use std::fmt::Write; - fn inner(args: std::fmt::Arguments<'_>) -> Result { - if let Some(s) = args.as_str() { - Ok(s.to_owned()) - } else { - let mut output = String::new(); - output.write_fmt(args).map(|_| output) - } - } - - inner(format_args!($($arg)*)) + let mut output = String::new(); + output.write_fmt(format_args!($($arg)*)).map(|_| output) }} }