From 7660978ee5d842648e244e2972273264d94ca37b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 12 Jun 2022 17:45:52 +0200 Subject: Move `Arc` into `Frame` --- src/util/mod.rs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src/util') diff --git a/src/util/mod.rs b/src/util/mod.rs index f762d88d..df3858d6 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -12,7 +12,7 @@ pub use prehashed::Prehashed; use std::any::TypeId; use std::cmp::Ordering; use std::fmt::{self, Debug, Formatter}; -use std::ops::{Deref, Range}; +use std::ops::Range; use std::path::{Component, Path, PathBuf}; use std::sync::Arc; @@ -64,31 +64,6 @@ impl Debug for ReadableTypeId { } } -/// Either owned or shared. -pub enum MaybeShared { - /// Owned data. - Owned(T), - /// Shared data. - Shared(Arc), -} - -impl AsRef for MaybeShared { - fn as_ref(&self) -> &T { - self - } -} - -impl Deref for MaybeShared { - type Target = T; - - fn deref(&self) -> &Self::Target { - match self { - Self::Owned(owned) => owned, - Self::Shared(shared) => shared, - } - } -} - /// Extra methods for [`str`]. pub trait StrExt { /// The number of code units this string would use if it was encoded in -- cgit v1.2.3