use std::fs;
use std::path::PathBuf;
use crate::error::Result;
#[derive(Debug)]
pub struct Replacer {
pub path: PathBuf,
pub temp_file: tempfile::NamedTempFile,
}
impl Replacer {
pub fn persist(self) -> Result<()> {
let path = fs::canonicalize(&self.path)?;
self.temp_file.persist(path)?;
Ok(())
}
}