From 616758ee81565d16fdc69a061c20ef1774a2a62d Mon Sep 17 00:00:00 2001 From: Nik Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Fri, 4 Apr 2025 08:19:40 +0100 Subject: [PATCH] refactor: rename macro _ --- helix-stdx/src/str.rs | 4 ++-- helix-stdx/src/time.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helix-stdx/src/str.rs b/helix-stdx/src/str.rs index e79cbcccc..942acea95 100644 --- a/helix-stdx/src/str.rs +++ b/helix-stdx/src/str.rs @@ -1,10 +1,10 @@ /// Concatenates strings together. /// -/// `concat!(a, " ", b, " ", c)` is: +/// `str_concat!(a, " ", b, " ", c)` is: /// - more performant than `format!("{a} {b} {c}")` /// - more ergonomic than using `String::with_capacity` followed by a series of `String::push_str` #[macro_export] -macro_rules! concat { +macro_rules! str_concat { ($($value:expr),*) => {{ // Rust does not allow using `+` as separator between value // so we must add that at the end of everything. The `0` is necessary diff --git a/helix-stdx/src/time.rs b/helix-stdx/src/time.rs index 4df88c45c..08a45988c 100644 --- a/helix-stdx/src/time.rs +++ b/helix-stdx/src/time.rs @@ -71,5 +71,5 @@ pub fn format_relative_time(timestamp: i64, timezone_offset: i32) -> String { "from now" }; - crate::concat!(value, " ", unit, " ", label) + crate::str_concat!(value, " ", unit, " ", label) }