mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
use into
This commit is contained in:
parent
157f13c984
commit
659ca5edfc
1 changed files with 2 additions and 2 deletions
|
|
@ -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)?
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue