diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-01 09:03:47 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-01 09:03:47 +0100 |
commit | 686e115e7397028a94bde57df1acf0f066651285 (patch) | |
tree | 2a854f0f74ef4865c0b4196ed0a31abd0da74e2d /crates/ra_db/src/fixture.rs | |
parent | 30c2e714cc1677cbea40a47d7c0944c92f66b7c9 (diff) | |
parent | 80386ca5be78d8ea65483df3edeec1a89b09a5a3 (diff) |
Merge #5158
5158: Use CrateName correctly r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_db/src/fixture.rs')
-rw-r--r-- | crates/ra_db/src/fixture.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 4f4fb4494..209713987 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -149,15 +149,17 @@ fn with_files( | |||
149 | let crate_id = crate_graph.add_crate_root( | 149 | let crate_id = crate_graph.add_crate_root( |
150 | file_id, | 150 | file_id, |
151 | meta.edition, | 151 | meta.edition, |
152 | Some(CrateName::new(&krate).unwrap()), | 152 | Some(krate.clone()), |
153 | meta.cfg, | 153 | meta.cfg, |
154 | meta.env, | 154 | meta.env, |
155 | Default::default(), | 155 | Default::default(), |
156 | ); | 156 | ); |
157 | let prev = crates.insert(krate.clone(), crate_id); | 157 | let crate_name = CrateName::new(&krate).unwrap(); |
158 | let prev = crates.insert(crate_name.clone(), crate_id); | ||
158 | assert!(prev.is_none()); | 159 | assert!(prev.is_none()); |
159 | for dep in meta.deps { | 160 | for dep in meta.deps { |
160 | crate_deps.push((krate.clone(), dep)) | 161 | let dep = CrateName::new(&dep).unwrap(); |
162 | crate_deps.push((crate_name.clone(), dep)) | ||
161 | } | 163 | } |
162 | } else if meta.path == "/main.rs" || meta.path == "/lib.rs" { | 164 | } else if meta.path == "/main.rs" || meta.path == "/lib.rs" { |
163 | assert!(default_crate_root.is_none()); | 165 | assert!(default_crate_root.is_none()); |