MCPcopy Index your code
hub / github.com/aws/clock-bound / clear

Function clear

clock-bound/src/daemon/clock_sync_algorithm/ring_buffer.rs:254–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

252
253 #[test]
254 fn clear() {
255 let mut buffer = RingBuffer::new(NonZeroUsize::new(3).unwrap());
256
257 buffer.push(1);
258 buffer.push(2);
259 buffer.clear();
260
261 assert!(buffer.is_empty());
262 assert_eq!(buffer.len(), 0);
263 assert_eq!(buffer.head(), None);
264 assert_eq!(buffer.tail(), None);
265 }
266
267 #[test]
268 fn iter() {

Callers

nothing calls this directly

Calls 3

newFunction · 0.50
pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected