bip_disk 0.6.0

Bittorrent Infrastructure Project Disk Module
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::path::{Path, PathBuf};

use bip_metainfo::File;

pub mod piece_accessor;
pub mod piece_checker;

pub fn build_path(parent_directory: Option<&Path>, file: &File) -> PathBuf {
    match parent_directory {
        Some(dir) => PathBuf::from(dir).join(file.path()),
        None      => file.path().to_owned()
    }
}