diff options
author | Aleksey Kladov <[email protected]> | 2020-06-22 16:30:23 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-22 23:14:44 +0100 |
commit | 6a6098d4c31f6b54c8768e32f24182645ac077d6 (patch) | |
tree | 66879957613620b5c2788f9d98ac36fd24a603d6 /crates/ra_db | |
parent | 5a0331e5575034a145956f76316ee0fcdf72077e (diff) |
Remove RelativePathBuf from fixture
The paths in fixture are not really relative (the default one is
`/main.rs`), so it doesn't make sense to use `RelativePathBuf` here.
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/fixture.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 482a2f3e6..af8fe11ec 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -164,7 +164,7 @@ fn with_files(db: &mut dyn SourceDatabaseExt, fixture: &str) -> Option<FilePosit | |||
164 | 164 | ||
165 | let mut source_root = SourceRoot::new_local(); | 165 | let mut source_root = SourceRoot::new_local(); |
166 | let mut source_root_id = WORKSPACE; | 166 | let mut source_root_id = WORKSPACE; |
167 | let mut source_root_prefix: RelativePathBuf = "/".into(); | 167 | let mut source_root_prefix = "/".to_string(); |
168 | let mut file_id = FileId(0); | 168 | let mut file_id = FileId(0); |
169 | 169 | ||
170 | let mut file_position = None; | 170 | let mut file_position = None; |
@@ -212,9 +212,9 @@ fn with_files(db: &mut dyn SourceDatabaseExt, fixture: &str) -> Option<FilePosit | |||
212 | }; | 212 | }; |
213 | 213 | ||
214 | db.set_file_text(file_id, Arc::new(text)); | 214 | db.set_file_text(file_id, Arc::new(text)); |
215 | db.set_file_relative_path(file_id, meta.path.clone()); | 215 | db.set_file_relative_path(file_id, meta.path.clone().into()); |
216 | db.set_file_source_root(file_id, source_root_id); | 216 | db.set_file_source_root(file_id, source_root_id); |
217 | source_root.insert_file(meta.path, file_id); | 217 | source_root.insert_file(meta.path.into(), file_id); |
218 | 218 | ||
219 | file_id.0 += 1; | 219 | file_id.0 += 1; |
220 | } | 220 | } |
@@ -245,12 +245,12 @@ fn with_files(db: &mut dyn SourceDatabaseExt, fixture: &str) -> Option<FilePosit | |||
245 | } | 245 | } |
246 | 246 | ||
247 | enum ParsedMeta { | 247 | enum ParsedMeta { |
248 | Root { path: RelativePathBuf }, | 248 | Root { path: String }, |
249 | File(FileMeta), | 249 | File(FileMeta), |
250 | } | 250 | } |
251 | 251 | ||
252 | struct FileMeta { | 252 | struct FileMeta { |
253 | path: RelativePathBuf, | 253 | path: String, |
254 | krate: Option<String>, | 254 | krate: Option<String>, |
255 | deps: Vec<String>, | 255 | deps: Vec<String>, |
256 | cfg: CfgOptions, | 256 | cfg: CfgOptions, |