aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/macros.rs b/src/macros.rs
index d87ea98..558a4a9 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -31,23 +31,3 @@ macro_rules! time {
(result, dt)
}};
}
-
-/// Conditionally perform string formatting.
-///
-/// If `$enabled` is true, then do the formatting and return a `Cow::Owned`.
-///
-/// Otherwise, just return the borrowed (often `'static`) string
-/// `$borrowed`.
-///
-/// When `$enabled` is false, this avoids the overhead of allocating
-/// and writing to a buffer, as well as any overhead or side effects
-/// of the format arguments.
-macro_rules! format_if {
- ($enabled:expr, $borrowed:expr, $fmt:expr, $($args:expr),*) => {
- if $enabled {
- ::std::borrow::Cow::Owned(format!($fmt, $($args),*)) as ::std::borrow::Cow<str>
- } else {
- ::std::borrow::Cow::Borrowed($borrowed)
- }
- }
-}