Apply the reviews suggestions

This commit is contained in:
Kirill Bulatov 2020-02-05 12:47:28 +02:00
parent 2b9952625b
commit 78092c7c66
5 changed files with 64 additions and 32 deletions

View file

@ -3,7 +3,7 @@
use std::sync::Arc;
use ra_cfg::CfgOptions;
use ra_db::{Env, RelativePathBuf};
use ra_db::{CrateName, Env, RelativePathBuf};
use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER};
use crate::{
@ -107,7 +107,9 @@ impl MockAnalysis {
crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default());
let crate_name = path.parent().unwrap().file_name().unwrap();
if let Some(root_crate) = root_crate {
crate_graph.add_dep(root_crate, crate_name.into(), other_crate).unwrap();
crate_graph
.add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate)
.unwrap();
}
}
change.add_file(source_root, file_id, path, Arc::new(contents));