diff options
author | Jeremy A. Kolb <[email protected]> | 2018-11-29 20:30:49 +0000 |
---|---|---|
committer | Jeremy A. Kolb <[email protected]> | 2018-11-29 20:30:49 +0000 |
commit | f32dc7135175c1e8a9ea81d7c18c21b2722f28c5 (patch) | |
tree | 7f63a507106e33d4c4b1282e901fbcecc4c30143 /crates/ra_lsp_server/src/path_map.rs | |
parent | 70a7cb34ec18d30a680a73727e1d87a0a786dc44 (diff) |
Clippy lints
Diffstat (limited to 'crates/ra_lsp_server/src/path_map.rs')
-rw-r--r-- | crates/ra_lsp_server/src/path_map.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/path_map.rs b/crates/ra_lsp_server/src/path_map.rs index a624043d8..33babda4b 100644 --- a/crates/ra_lsp_server/src/path_map.rs +++ b/crates/ra_lsp_server/src/path_map.rs | |||
@@ -33,7 +33,7 @@ impl PathMap { | |||
33 | let file_id = self | 33 | let file_id = self |
34 | .path2id | 34 | .path2id |
35 | .get(path.as_path()) | 35 | .get(path.as_path()) |
36 | .map(|&id| id) | 36 | .cloned() |
37 | .unwrap_or_else(|| { | 37 | .unwrap_or_else(|| { |
38 | inserted = true; | 38 | inserted = true; |
39 | let id = self.new_file_id(); | 39 | let id = self.new_file_id(); |
@@ -43,7 +43,7 @@ impl PathMap { | |||
43 | (inserted, file_id) | 43 | (inserted, file_id) |
44 | } | 44 | } |
45 | pub fn get_id(&self, path: &Path) -> Option<FileId> { | 45 | pub fn get_id(&self, path: &Path) -> Option<FileId> { |
46 | self.path2id.get(path).map(|&id| id) | 46 | self.path2id.get(path).cloned() |
47 | } | 47 | } |
48 | pub fn get_path(&self, file_id: FileId) -> &Path { | 48 | pub fn get_path(&self, file_id: FileId) -> &Path { |
49 | self.id2path.get(&file_id).unwrap().as_path() | 49 | self.id2path.get(&file_id).unwrap().as_path() |