MCPcopy Create free account
hub / github.com/douchuan/algorithm / peek

Method peek

src/common/stack.rs:22–24  ·  view source on GitHub ↗

Returns (but does not remove) the item most recently added to this stack.

(&self)

Source from the content-addressed store, hash-verified

20
21 /// Returns (but does not remove) the item most recently added to this stack.
22 pub fn peek(&self) -> Option<&T> {
23 self.ll.first()
24 }
25
26 /// Returns an iterator to this stack that iterates through the items in LIFO order.
27 pub fn iter(&self) -> Iter<'_, T> {

Callers 1

markMethod · 0.45

Calls 1

firstMethod · 0.80

Tested by

no test coverage detected