This commit is contained in:
yggverse 2025-08-03 14:47:09 +03:00
parent 157f13c984
commit 659ca5edfc

View file

@ -25,12 +25,12 @@ impl Preload {
} }
pub fn clear_output_folder(&self, info_hash: &str) -> Result<()> { pub fn clear_output_folder(&self, info_hash: &str) -> Result<()> {
Ok(fs::remove_dir_all(&self.path(&PathBuf::from(info_hash))?)?) Ok(fs::remove_dir_all(&self.path(&info_hash.into())?)?)
} }
/// * create new directory if not exists /// * create new directory if not exists
pub fn output_folder(&self, info_hash: &str) -> Result<PathBuf> { pub fn output_folder(&self, info_hash: &str) -> Result<PathBuf> {
let p = self.path(&PathBuf::from(info_hash))?; let p = self.path(&info_hash.into())?;
if !p.exists() { if !p.exists() {
fs::create_dir(&p)? fs::create_dir(&p)?
} }