Skip to content

Commit 16cb5aa

Browse files
committed
refactor(access): implement Writeable via RestrictAccess
Signed-off-by: Martin Kröning <[email protected]>
1 parent a9d9665 commit 16cb5aa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/access.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub trait Readable: Copy + Default + private::Sealed {
6161

6262
/// Helper trait that is implemented by [`ReadWrite`] and [`WriteOnly`].
6363
pub trait Writable: Access + private::Sealed {}
64+
impl<A: RestrictAccess<WriteOnly, Restricted = WriteOnly>> Writable for A {}
6465

6566
/// Implemented for access types that permit copying of `VolatileRef`.
6667
pub trait Copyable: private::Sealed {}
@@ -80,7 +81,6 @@ pub struct ReadWrite;
8081
impl Readable for ReadWrite {
8182
type RestrictShared = ReadOnly;
8283
}
83-
impl Writable for ReadWrite {}
8484

8585
/// Zero-sized marker type for allowing only read access.
8686
#[derive(Debug, Default, Copy, Clone)]
@@ -95,7 +95,6 @@ pub struct WriteOnly;
9595
impl Access for WriteOnly {
9696
type RestrictShared = NoAccess;
9797
}
98-
impl Writable for WriteOnly {}
9998

10099
/// Zero-sized marker type that grants no access.
101100
#[derive(Debug, Default, Copy, Clone)]

0 commit comments

Comments
 (0)