Skip to content

Commit 25cbee3

Browse files
committed
feat(access): remove RestrictShared
Signed-off-by: Martin Kröning <[email protected]>
1 parent 24a3177 commit 25cbee3

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

src/access.rs

+7-25
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,11 @@ restrict_impl!(WriteOnly, WriteOnly, WriteOnly);
4646
restrict_impl!(WriteOnly, NoAccess, NoAccess);
4747

4848
/// Sealed trait that is implemented for the types in this module.
49-
pub trait Access: Copy + Default + private::Sealed {
50-
/// Reduced access level to safely share the corresponding value.
51-
#[deprecated = "replaced by `RestrictAccess<ReadOnly>::Restricted`"]
52-
type RestrictShared: Access;
53-
}
49+
pub trait Access: Copy + Default + private::Sealed {}
5450

5551
/// Helper trait that is implemented by [`ReadWrite`] and [`ReadOnly`].
56-
pub trait Readable: Copy + Default + private::Sealed {
57-
/// Reduced access level to safely share the corresponding value.
58-
#[deprecated = "replaced by `RestrictAccess<ReadOnly>::Restricted`"]
59-
type RestrictShared: Readable + Access;
60-
}
61-
impl<A: RestrictAccess<ReadOnly, Restricted = ReadOnly>> Readable for A {
62-
type RestrictShared = <Self as RestrictAccess<ReadOnly>>::Restricted;
63-
}
52+
pub trait Readable: Copy + Default + private::Sealed {}
53+
impl<A: RestrictAccess<ReadOnly, Restricted = ReadOnly>> Readable for A {}
6454

6555
/// Helper trait that is implemented by [`ReadWrite`] and [`WriteOnly`].
6656
pub trait Writable: Access + private::Sealed {}
@@ -73,30 +63,22 @@ impl<A: RestrictAccess<ReadOnly, Restricted = Self>> Copyable for A {}
7363
/// Zero-sized marker type for allowing both read and write access.
7464
#[derive(Debug, Default, Copy, Clone)]
7565
pub struct ReadWrite;
76-
impl Access for ReadWrite {
77-
type RestrictShared = <Self as RestrictAccess<ReadOnly>>::Restricted;
78-
}
66+
impl Access for ReadWrite {}
7967

8068
/// Zero-sized marker type for allowing only read access.
8169
#[derive(Debug, Default, Copy, Clone)]
8270
pub struct ReadOnly;
83-
impl Access for ReadOnly {
84-
type RestrictShared = <Self as RestrictAccess<ReadOnly>>::Restricted;
85-
}
71+
impl Access for ReadOnly {}
8672

8773
/// Zero-sized marker type for allowing only write access.
8874
#[derive(Debug, Default, Copy, Clone)]
8975
pub struct WriteOnly;
90-
impl Access for WriteOnly {
91-
type RestrictShared = <Self as RestrictAccess<ReadOnly>>::Restricted;
92-
}
76+
impl Access for WriteOnly {}
9377

9478
/// Zero-sized marker type that grants no access.
9579
#[derive(Debug, Default, Copy, Clone)]
9680
pub struct NoAccess;
97-
impl Access for NoAccess {
98-
type RestrictShared = <Self as RestrictAccess<ReadOnly>>::Restricted;
99-
}
81+
impl Access for NoAccess {}
10082

10183
mod private {
10284
pub trait Sealed {}

0 commit comments

Comments
 (0)