diff options
author | Aleksey Kladov <[email protected]> | 2018-10-15 19:54:12 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-15 19:54:12 +0100 |
commit | 7503c5528f20f7404bac6f70bcf2120edb54dc52 (patch) | |
tree | 24fcb97a156f01c38a3e3f5e6b6d031870bbcb43 /crates/ra_analysis/src/imp.rs | |
parent | 062019590d70279d82fef3a60a2caf9490f8b97b (diff) |
fix tests
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 26f5e175b..6e6c022d9 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -3,6 +3,7 @@ use std::{ | |||
3 | Arc, | 3 | Arc, |
4 | atomic::{AtomicBool, Ordering::SeqCst}, | 4 | atomic::{AtomicBool, Ordering::SeqCst}, |
5 | }, | 5 | }, |
6 | hash::{Hash, Hasher}, | ||
6 | fmt, | 7 | fmt, |
7 | collections::VecDeque, | 8 | collections::VecDeque, |
8 | iter, | 9 | iter, |
@@ -29,6 +30,21 @@ pub(crate) struct FileResolverImp { | |||
29 | inner: Arc<FileResolver> | 30 | inner: Arc<FileResolver> |
30 | } | 31 | } |
31 | 32 | ||
33 | impl PartialEq for FileResolverImp { | ||
34 | fn eq(&self, other: &FileResolverImp) -> bool { | ||
35 | self.inner() == other.inner() | ||
36 | } | ||
37 | } | ||
38 | |||
39 | impl Eq for FileResolverImp { | ||
40 | } | ||
41 | |||
42 | impl Hash for FileResolverImp { | ||
43 | fn hash<H: Hasher>(&self, hasher: &mut H) { | ||
44 | self.inner().hash(hasher); | ||
45 | } | ||
46 | } | ||
47 | |||
32 | impl FileResolverImp { | 48 | impl FileResolverImp { |
33 | pub(crate) fn new(inner: Arc<FileResolver>) -> FileResolverImp { | 49 | pub(crate) fn new(inner: Arc<FileResolver>) -> FileResolverImp { |
34 | FileResolverImp { inner } | 50 | FileResolverImp { inner } |
@@ -39,6 +55,9 @@ impl FileResolverImp { | |||
39 | pub(crate) fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> { | 55 | pub(crate) fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> { |
40 | self.inner.resolve(file_id, path) | 56 | self.inner.resolve(file_id, path) |
41 | } | 57 | } |
58 | fn inner(&self) -> *const FileResolver { | ||
59 | &*self.inner | ||
60 | } | ||
42 | } | 61 | } |
43 | 62 | ||
44 | impl Default for FileResolverImp { | 63 | impl Default for FileResolverImp { |