Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 2146bc87..62cf3592 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -1648,7 +1648,7 @@ impl Editor {
let Some(doc_url) = doc.url() else {
return;
};
- let (lang, path) = (doc.language.clone(), doc.path().cloned());
+ let (lang, path) = (doc.language.clone(), doc.path());
let config = doc.config.load();
let root_dirs = &config.workspace_lsp_roots;
@@ -1664,7 +1664,7 @@ impl Editor {
// store only successfully started language servers
let language_servers = lang.as_ref().map_or_else(HashMap::default, |language| {
self.language_servers
- .get(language, path.as_ref(), root_dirs, config.lsp.snippets)
+ .get(language, path, root_dirs, config.lsp.snippets)
.filter_map(|(lang, client)| match client {
Ok(client) => Some((lang, client)),
Err(err) => {
@@ -2179,12 +2179,12 @@ impl Editor {
pub fn document_by_path<P: AsRef<Path>>(&self, path: P) -> Option<&Document> {
self.documents()
- .find(|doc| doc.path().map(|p| p == path.as_ref()).unwrap_or(false))
+ .find(|doc| doc.path().is_some_and(|p| p == path.as_ref()))
}
pub fn document_by_path_mut<P: AsRef<Path>>(&mut self, path: P) -> Option<&mut Document> {
self.documents_mut()
- .find(|doc| doc.path().map(|p| p == path.as_ref()).unwrap_or(false))
+ .find(|doc| doc.path().is_some_and(|p| p == path.as_ref()))
}
/// Returns all supported diagnostics for the document