Skip to content

Commit

Permalink
Remove mut from Puntuated::get()
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Jul 12, 2024
1 parent 5c67e26 commit dd7e269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/punctuated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<T, P> Punctuated<T, P> {
}

/// Borrows the element at the given index.
pub fn get(&mut self, index: usize) -> Option<&T> {
pub fn get(&self, index: usize) -> Option<&T> {
if let Some((value, _punct)) = self.inner.get(index) {
Some(value)
} else if index == self.inner.len() {
Expand Down

0 comments on commit dd7e269

Please sign in to comment.