mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Add peek method to circular buffer.
This commit is contained in:
committed by
Graydon Hoare
parent
17fa6bfd9a
commit
d6cba83322
@@ -127,6 +127,11 @@ circular_buffer::dequeue(void *dst) {
|
||||
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
circular_buffer::peek() {
|
||||
return &_buffer[_next];
|
||||
}
|
||||
|
||||
bool
|
||||
circular_buffer::is_empty() {
|
||||
return _unread == 0;
|
||||
|
||||
Reference in New Issue
Block a user