add peek comment
This commit is contained in:
parent
337b1ab05b
commit
edaca0a9fd
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ impl<T: Debug> Stack<T> {
|
|||
self.storage.pop()
|
||||
}
|
||||
|
||||
//
|
||||
/// Returns the top element from the stack without removing it.
|
||||
pub fn peek(&self) -> Option<&T> {
|
||||
self.storage.last()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue