session: Cleanup CanonicalizedPath::new

It wants an owned path, so pass an owned path
This commit is contained in:
Vadim Petrochenkov
2025-04-26 18:42:15 +03:00
parent 5ae50d3b21
commit 86969dbe77
3 changed files with 8 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
use std::path::{Path, PathBuf};
use std::path::PathBuf;
use std::sync::OnceLock;
use rustc_data_structures::profiling::VerboseTimingGuard;
@@ -104,8 +104,8 @@ pub struct CanonicalizedPath {
}
impl CanonicalizedPath {
pub fn new(path: &Path) -> Self {
Self { original: path.to_owned(), canonicalized: try_canonicalize(path).ok() }
pub fn new(path: PathBuf) -> Self {
Self { canonicalized: try_canonicalize(&path).ok(), original: path }
}
pub fn canonicalized(&self) -> &PathBuf {