refactor: rename macro

_
pull/13133/head
Nik Revenco 2025-04-04 08:19:40 +01:00
parent c74fec4c6e
commit 616758ee81
2 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
/// Concatenates strings together. /// Concatenates strings together.
/// ///
/// `concat!(a, " ", b, " ", c)` is: /// `str_concat!(a, " ", b, " ", c)` is:
/// - more performant than `format!("{a} {b} {c}")` /// - more performant than `format!("{a} {b} {c}")`
/// - more ergonomic than using `String::with_capacity` followed by a series of `String::push_str` /// - more ergonomic than using `String::with_capacity` followed by a series of `String::push_str`
#[macro_export] #[macro_export]
macro_rules! concat { macro_rules! str_concat {
($($value:expr),*) => {{ ($($value:expr),*) => {{
// Rust does not allow using `+` as separator between value // Rust does not allow using `+` as separator between value
// so we must add that at the end of everything. The `0` is necessary // so we must add that at the end of everything. The `0` is necessary

View File

@ -71,5 +71,5 @@ pub fn format_relative_time(timestamp: i64, timezone_offset: i32) -> String {
"from now" "from now"
}; };
crate::concat!(value, " ", unit, " ", label) crate::str_concat!(value, " ", unit, " ", label)
} }