Skip to content

Commit dd122e9

Browse files
committed
Derive Clone for Volatile wrappers
1 parent 670967a commit dd122e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use core::ptr;
3434
/// take and return copies of the value.
3535
///
3636
/// The size of this struct is the same as the size of the contained type.
37-
#[derive(Debug)]
37+
#[derive(Debug, Clone)]
3838
pub struct Volatile<T: Copy>(T);
3939

4040
impl<T: Copy> Volatile<T> {
@@ -143,7 +143,7 @@ impl<T: Copy> Volatile<T> {
143143
/// A volatile wrapper which only allows read operations.
144144
///
145145
/// The size of this struct is the same as the contained type.
146-
#[derive(Debug)]
146+
#[derive(Debug, Clone)]
147147
pub struct ReadOnly<T: Copy>(Volatile<T>);
148148

149149
impl<T: Copy> ReadOnly<T> {
@@ -200,7 +200,7 @@ impl<T: Copy> ReadOnly<T> {
200200
/// A volatile wrapper which only allows write operations.
201201
///
202202
/// The size of this struct is the same as the contained type.
203-
#[derive(Debug)]
203+
#[derive(Debug, Clone)]
204204
pub struct WriteOnly<T: Copy>(Volatile<T>);
205205

206206
impl<T: Copy> WriteOnly<T> {

0 commit comments

Comments
 (0)