perf: use next_back on DoubleEndedIterator

This commit is contained in:
Rolo
2025-04-03 14:37:20 -07:00
committed by Michael Davis
parent 1bc45c8b3a
commit 5b72b59448
3 changed files with 4 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ fn workspace_for_uri(uri: lsp::Url) -> WorkspaceFolder {
lsp::WorkspaceFolder {
name: uri
.path_segments()
.and_then(|segments| segments.last())
.and_then(|mut segments| segments.next_back())
.map(|basename| basename.to_string())
.unwrap_or_default(),
uri,