Skip to content

Commit 167adec

Browse files
committed
add VolatilePtr::is_empty
1 parent a9e8509 commit 167adec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ impl<'a, T, R, W> VolatilePtr<'a, [T], Access<R, W>> {
396396
self.pointer.len()
397397
}
398398

399+
pub fn is_empty(&self) -> bool {
400+
self.pointer.len() == 0
401+
}
402+
399403
/// Applies the index operation on the wrapped slice.
400404
///
401405
/// Returns a shared `Volatile` reference to the resulting subslice.

0 commit comments

Comments
 (0)