rust-osdev / volatile

Apache License 2.0
70 stars 19 forks source link

ReadWrite type is redundant #2

Closed blacksmithgu closed 7 years ago

blacksmithgu commented 7 years ago

The ReadWrite type is functionally equivalent to the Volatile type. Is there any reason for having this, or is it for consistency's sake with ReadOnly and WriteOnly (in case the semantics of Volatile change)?

phil-opp commented 7 years ago

It's just for consistency. When you just need a volatile wrapper, the name Volatile makes more sense than ReadWrite. However, when using ReadOnly and WriteOnly (e.g. to describe memory mapped hardware registers), the name ReadWrite fits better.

I agree that a separate ReadWrite struct is redundant. We should make ReadWrite a type alias for Volatile instead (pub type ReadWrite = Volatile;).

blacksmithgu commented 7 years ago

Ah, that would fix it nicely!