diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-22 23:15:22 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-22 23:15:22 +0100 |
commit | 98c3e4e887dcc5a8242c3e67c04a3cedbb1b9c58 (patch) | |
tree | 34caf163e19c51ea286b3e64698b29d0af22cfe2 /crates/ra_db | |
parent | ceb69203b55d83aeaf4e58bff4a58f2f17d4087d (diff) | |
parent | 6a6098d4c31f6b54c8768e32f24182645ac077d6 (diff) |
Merge #5000
5000: Remove RelativePathBuf from fixture r=matklad a=matklad
The paths in fixture are not really relative (the default one is
`/main.rs`), so it doesn't make sense to use `RelativePathBuf` here.
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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, |