Remove unused abs_path method from rustc_span::source_map::FileLoader

This commit is contained in:
Shea Levy 2020-04-17 17:51:32 -04:00
parent 8d67f576b5
commit c7899a027e
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27

View File

@ -20,7 +20,6 @@
use std::sync::atomic::Ordering;
use log::debug;
use std::env;
use std::fs;
use std::io;
@ -64,9 +63,6 @@ pub trait FileLoader {
/// Query the existence of a file.
fn file_exists(&self, path: &Path) -> bool;
/// Returns an absolute path to a file, if possible.
fn abs_path(&self, path: &Path) -> Option<PathBuf>;
/// Read the contents of an UTF-8 file into memory.
fn read_file(&self, path: &Path) -> io::Result<String>;
}
@ -79,14 +75,6 @@ fn file_exists(&self, path: &Path) -> bool {
fs::metadata(path).is_ok()
}
fn abs_path(&self, path: &Path) -> Option<PathBuf> {
if path.is_absolute() {
Some(path.to_path_buf())
} else {
env::current_dir().ok().map(|cwd| cwd.join(path))
}
}
fn read_file(&self, path: &Path) -> io::Result<String> {
fs::read_to_string(path)
}