diff options
author | Aleksey Kladov <[email protected]> | 2018-11-04 11:09:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-04 11:09:21 +0000 |
commit | f29b0172fbcbc88160980c2e7359f92d7c0d885d (patch) | |
tree | 4ec1f709d283d3ea0b7c225a70f6439d67a5ca32 /crates/ra_lsp_server/src/path_map.rs | |
parent | cca5f862de8a4eb4a8990fdca95a4a7686937789 (diff) |
Use Default everywhere
Diffstat (limited to 'crates/ra_lsp_server/src/path_map.rs')
-rw-r--r-- | crates/ra_lsp_server/src/path_map.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/path_map.rs b/crates/ra_lsp_server/src/path_map.rs index dd09fa10a..87eabf9be 100644 --- a/crates/ra_lsp_server/src/path_map.rs +++ b/crates/ra_lsp_server/src/path_map.rs | |||
@@ -28,9 +28,6 @@ impl fmt::Debug for PathMap { | |||
28 | } | 28 | } |
29 | 29 | ||
30 | impl PathMap { | 30 | impl PathMap { |
31 | pub fn new() -> PathMap { | ||
32 | Default::default() | ||
33 | } | ||
34 | pub fn get_or_insert(&mut self, path: PathBuf, root: Root) -> (bool, FileId) { | 31 | pub fn get_or_insert(&mut self, path: PathBuf, root: Root) -> (bool, FileId) { |
35 | let mut inserted = false; | 32 | let mut inserted = false; |
36 | let file_id = self | 33 | let file_id = self |
@@ -117,7 +114,7 @@ mod test { | |||
117 | 114 | ||
118 | #[test] | 115 | #[test] |
119 | fn test_resolve() { | 116 | fn test_resolve() { |
120 | let mut m = PathMap::new(); | 117 | let mut m = PathMap::default(); |
121 | let (_, id1) = m.get_or_insert(PathBuf::from("/foo"), Root::Workspace); | 118 | let (_, id1) = m.get_or_insert(PathBuf::from("/foo"), Root::Workspace); |
122 | let (_, id2) = m.get_or_insert(PathBuf::from("/foo/bar.rs"), Root::Workspace); | 119 | let (_, id2) = m.get_or_insert(PathBuf::from("/foo/bar.rs"), Root::Workspace); |
123 | assert_eq!(m.resolve(id1, &RelativePath::new("bar.rs")), Some(id2),) | 120 | assert_eq!(m.resolve(id1, &RelativePath::new("bar.rs")), Some(id2),) |