Skip to content

Commit 38d9666

Browse files
committed
fix mutability of back()
weird oversight, probably an artifact from a previous life as lru_cache. fixes #95
1 parent b203878 commit 38d9666

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> LinkedHashMap<K, V, S> {
589589
/// assert_eq!(map.back(), Some((&2, &20)));
590590
/// ```
591591
#[inline]
592-
pub fn back(&mut self) -> Option<(&K, &V)> {
592+
pub fn back(&self) -> Option<(&K, &V)> {
593593
if self.is_empty() {
594594
return None;
595595
}

0 commit comments

Comments
 (0)