aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/world.rs
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-12-20 20:14:30 +0000
committerkjeremy <[email protected]>2019-12-20 20:14:30 +0000
commit0d5d63a80ea08f2af439bcc72fff9b24d144c70d (patch)
tree688102f3cfdec260f5164d60f0bb95e33ebe9674 /crates/ra_lsp_server/src/world.rs
parent9467f81c588bf7a62ec882f293e0870c187b368b (diff)
Clippy lints
Diffstat (limited to 'crates/ra_lsp_server/src/world.rs')
-rw-r--r--crates/ra_lsp_server/src/world.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index 16cc11e8c..f89b23089 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -287,19 +287,15 @@ impl WorldSnapshot {
287/// 287///
288/// When processing non-windows path, this is essentially the same as `Url::from_file_path`. 288/// When processing non-windows path, this is essentially the same as `Url::from_file_path`.
289fn url_from_path_with_drive_lowercasing(path: impl AsRef<Path>) -> Result<Url> { 289fn url_from_path_with_drive_lowercasing(path: impl AsRef<Path>) -> Result<Url> {
290 let component_has_windows_drive = path 290 let component_has_windows_drive = path.as_ref().components().any(|comp| {
291 .as_ref() 291 if let Component::Prefix(c) = comp {
292 .components() 292 match c.kind() {
293 .find(|comp| { 293 Prefix::Disk(_) | Prefix::VerbatimDisk(_) => return true,
294 if let Component::Prefix(c) = comp { 294 _ => return false,
295 match c.kind() {
296 Prefix::Disk(_) | Prefix::VerbatimDisk(_) => return true,
297 _ => return false,
298 }
299 } 295 }
300 false 296 }
301 }) 297 false
302 .is_some(); 298 });
303 299
304 // VSCode expects drive letters to be lowercased, where rust will uppercase the drive letters. 300 // VSCode expects drive letters to be lowercased, where rust will uppercase the drive letters.
305 if component_has_windows_drive { 301 if component_has_windows_drive {