use std::io;
use std::path::{Path, PathBuf};
use crate::pal::Filesystem;
#[derive(Debug, Default)]
pub(crate) struct BuildTargetFilesystem;
#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg_attr(test, mutants::skip)]
impl Filesystem for BuildTargetFilesystem {
fn cargo_toml_exists(&self, dir: &Path) -> bool {
dir.join("Cargo.toml").exists()
}
fn read_cargo_toml(&self, dir: &Path) -> io::Result<String> {
std::fs::read_to_string(dir.join("Cargo.toml"))
}
fn is_file(&self, path: &Path) -> bool {
path.is_file()
}
fn canonicalize(&self, path: &Path) -> io::Result<PathBuf> {
path.canonicalize()
}
fn current_dir(&self) -> io::Result<PathBuf> {
std::env::current_dir()
}
fn exists(&self, path: &Path) -> bool {
path.exists()
}
}