add peek comment

This commit is contained in:
Denis-Cosmin Nutiu 2025-01-11 17:08:01 +02:00
parent 337b1ab05b
commit edaca0a9fd

View file

@ -23,7 +23,7 @@ impl<T: Debug> Stack<T> {
self.storage.pop() self.storage.pop()
} }
// /// Returns the top element from the stack without removing it.
pub fn peek(&self) -> Option<&T> { pub fn peek(&self) -> Option<&T> {
self.storage.last() self.storage.last()
} }