From 2fb52d32bbce9716c76e08579cf5c716366945fe Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 16 May 2020 15:40:41 -0500 Subject: [PATCH] Make Either private --- src/either.rs | 7 ------- src/lib.rs | 2 +- src/primitives.rs | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/either.rs b/src/either.rs index d2bbffa..b1e110d 100644 --- a/src/either.rs +++ b/src/either.rs @@ -30,11 +30,4 @@ impl Either { Either::Right(ref r) => Either::Right(r), } } - - pub fn as_mut(&mut self) -> Either<&mut L, &mut R> { - match self { - Either::Left(ref mut l) => Either::Left(l), - Either::Right(ref mut r) => Either::Right(r), - } - } } diff --git a/src/lib.rs b/src/lib.rs index 5c67516..8a8be4d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,7 +253,7 @@ pub mod activity; pub mod actor; pub mod base; pub mod collection; -pub mod either; +mod either; pub mod link; pub mod object; pub mod primitives; diff --git a/src/primitives.rs b/src/primitives.rs index 41edefe..39019b3 100644 --- a/src/primitives.rs +++ b/src/primitives.rs @@ -62,7 +62,7 @@ pub struct Unit(Either); /// ``` #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] #[serde(transparent)] -pub struct OneOrMany(pub Either>); +pub struct OneOrMany(pub(crate) Either>); impl AnyString { /// Borrow the AnyString as an XsdString