Checkpoint: render SVGs

This commit is contained in:
Antonio Scandurra 2023-10-04 10:51:47 +02:00
parent a1ee2db6d1
commit 4cf2ba20c2
13 changed files with 187 additions and 175 deletions

View file

@ -1,4 +1,5 @@
use std::{
borrow::Cow,
fmt::{self, Debug},
sync::Arc,
};
@ -47,6 +48,15 @@ impl From<String> for ArcCow<'_, str> {
}
}
impl<'a> From<Cow<'a, str>> for ArcCow<'a, str> {
fn from(value: Cow<'a, str>) -> Self {
match value {
Cow::Borrowed(borrowed) => Self::Borrowed(borrowed),
Cow::Owned(owned) => Self::Owned(owned.into()),
}
}
}
impl<'a, T: ?Sized + ToOwned> std::borrow::Borrow<T> for ArcCow<'a, T> {
fn borrow(&self) -> &T {
match self {