Skip to content

Commit 4aab2d5

Browse files
committed
Remove unneeded to_owned
1 parent 748f57c commit 4aab2d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/rust-analyzer/src/cli/analysis_stats.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl flags::AnalysisStats {
369369

370370
let parse = sema.parse(file_id);
371371
let file_txt = db.file_text(file_id);
372-
let path = vfs.file_path(file_id).as_path().unwrap().to_owned();
372+
let path = vfs.file_path(file_id).as_path().unwrap();
373373

374374
for node in parse.syntax().descendants() {
375375
let expr = match syntax::ast::Expr::cast(node.clone()) {
@@ -444,7 +444,7 @@ impl flags::AnalysisStats {
444444
edit.apply(&mut txt);
445445

446446
if self.validate_term_search {
447-
std::fs::write(&path, txt).unwrap();
447+
std::fs::write(path, txt).unwrap();
448448

449449
let res = ws.run_build_scripts(&cargo_config, &|_| ()).unwrap();
450450
if let Some(err) = res.error() {
@@ -493,7 +493,7 @@ impl flags::AnalysisStats {
493493
}
494494
// Revert file back to original state
495495
if self.validate_term_search {
496-
std::fs::write(&path, file_txt.to_string()).unwrap();
496+
std::fs::write(path, file_txt.to_string()).unwrap();
497497
}
498498

499499
bar.inc(1);

0 commit comments

Comments
 (0)