From d1377270fb8473ffa93fd9da9cd941ce282cbc88 Mon Sep 17 00:00:00 2001 From: rowan Date: Wed, 9 Jul 2025 13:41:13 -0400 Subject: [PATCH] impl for borrowed types --- crates/osstr_traits/src/impls.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/osstr_traits/src/impls.rs b/crates/osstr_traits/src/impls.rs index 3ed5cc7..3ee40ab 100644 --- a/crates/osstr_traits/src/impls.rs +++ b/crates/osstr_traits/src/impls.rs @@ -7,6 +7,18 @@ macro_rules! impl_os_from_str { f.write_str(&self.to_string()) } } + + impl $crate::OsDisplay for &$type { + fn fmt_os(&self, f: &mut OsStringFormatter) -> std::fmt::Result { + (**self).fmt_os(f) + } + } + + impl $crate::OsDisplay for &mut $type { + fn fmt_os(&self, f: &mut OsStringFormatter) -> std::fmt::Result { + (**self).fmt_os(f) + } + } }; }