Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/load-cargo/src/lib.rs')
-rw-r--r--crates/load-cargo/src/lib.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/load-cargo/src/lib.rs b/crates/load-cargo/src/lib.rs
index a1c089520d..fe680e47fe 100644
--- a/crates/load-cargo/src/lib.rs
+++ b/crates/load-cargo/src/lib.rs
@@ -361,8 +361,8 @@ fn load_crate_graph(
let changes = vfs.take_changes();
for file in changes {
if let vfs::Change::Create(v) | vfs::Change::Modify(v) = file.change {
- if let Ok(text) = std::str::from_utf8(&v) {
- analysis_change.change_file(file.file_id, Some(text.into()))
+ if let Ok(text) = String::from_utf8(v) {
+ analysis_change.change_file(file.file_id, Some(text))
}
}
}
@@ -419,14 +419,10 @@ impl ProcMacroExpander for Expander {
#[cfg(test)]
mod tests {
use ide_db::base_db::SourceDatabase;
+ use vfs::file_set::FileSetConfigBuilder;
use super::*;
- use ide_db::base_db::SourceRootId;
- use vfs::{file_set::FileSetConfigBuilder, VfsPath};
-
- use crate::SourceRootConfig;
-
#[test]
fn test_loading_rust_analyzer() {
let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap();