Skip to content

Commit

Permalink
Merge pull request #1706 from lemunozm/patch-1
Browse files Browse the repository at this point in the history
Remove mut from Puntuated::get()
  • Loading branch information
dtolnay authored Jul 12, 2024
2 parents 5c67e26 + dd7e269 commit 896d58b
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 896d58b

Please sign in to comment.