diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-06-12 17:45:52 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-06-12 20:51:31 +0200 |
| commit | 7660978ee5d842648e244e2972273264d94ca37b (patch) | |
| tree | 74e1c8bc578afa616ddcd6c4c9e79c3c3d311d78 /src/util/mod.rs | |
| parent | 6e3b1a2c80428d581d00b9d65e1c45401df2e210 (diff) | |
Move `Arc` into `Frame`
Diffstat (limited to 'src/util/mod.rs')
| -rw-r--r-- | src/util/mod.rs | 27 |
1 files changed, 1 insertions, 26 deletions
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<T> { - /// Owned data. - Owned(T), - /// Shared data. - Shared(Arc<T>), -} - -impl<T> AsRef<T> for MaybeShared<T> { - fn as_ref(&self) -> &T { - self - } -} - -impl<T> Deref for MaybeShared<T> { - 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 |
