Checkpoint

This commit is contained in:
Nathan Sobo 2023-09-14 18:51:03 -06:00
parent 378b2fbd9e
commit 4fd4f44bb7
5 changed files with 144 additions and 123 deletions

View file

@ -1,4 +1,7 @@
use std::sync::Arc;
use std::{
fmt::{self, Debug},
sync::Arc,
};
#[derive(PartialEq, Eq)]
pub enum ArcCow<'a, T: ?Sized> {
@ -72,3 +75,12 @@ impl<T: ?Sized> AsRef<T> for ArcCow<'_, T> {
}
}
}
impl<'a, T: ?Sized + Debug> Debug for ArcCow<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
ArcCow::Borrowed(borrowed) => Debug::fmt(borrowed, f),
ArcCow::Owned(owned) => Debug::fmt(&**owned, f),
}
}
}