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) }} }