impl fmt::Display for `BorrowedValue<str>`
@@ -2,7 +2,10 @@ use crate::lock::{
MapImmutable, PyImmutableMappedMutexGuard, PyMappedMutexGuard, PyMappedRwLockReadGuard,
PyMappedRwLockWriteGuard, PyMutexGuard, PyRwLockReadGuard, PyRwLockWriteGuard,
};
-use std::ops::{Deref, DerefMut};
+use std::{
+ fmt,
+ ops::{Deref, DerefMut},
+};
macro_rules! impl_from {
($lt:lifetime, $gen:ident, $t:ty, $($var:ident($from:ty),)*) => {
@@ -64,6 +67,12 @@ impl<T: ?Sized> Deref for BorrowedValue<'_, T> {
}
}
+impl fmt::Display for BorrowedValue<'_, str> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fmt::Display::fmt(self.deref(), f)
+ }
+}
+
#[derive(Debug)]
pub enum BorrowedValueMut<'a, T: ?Sized> {
RefMut(&'a mut T),
