Skip to content

Commit 0d48fdd

Browse files
committed
add VolatilePtr::is_empty
1 parent c62fa4b commit 0d48fdd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
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)