MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / front

Method front

contents/stacks_and_queues/code/rust/Queue.rs:16–18  ·  view source on GitHub ↗

Note that this returns a reference to the value This is in contrast to dequeue which gives ownership of the value

(&self)

Source from the content-addressed store, hash-verified

14 // Note that this returns a reference to the value
15 // This is in contrast to dequeue which gives ownership of the value
16 fn front(&self) -> Option<&T> {
17 self.list.front()
18 }
19
20 fn dequeue(&mut self) -> Option<T> {
21 self.list.pop_front()

Callers

nothing calls this directly

Calls 1

frontMethod · 0.65

Tested by

no test coverage detected