/// Creates a temporary data dir that is removed when TempDir is closed or goes out of scope.
Creates a temporary data dir that is removed when TempDir is closed or goes out of scope.
Creates a temporary data dir that is removed when TempDir is closed or goes out of scope .
pub fn data_dir() -> (TempDir, PathBuf) {
        let tmp = TempDir::new().unwrap();
        let dir = tmp.path().to_owned();
        // data.slf contains foo.txt
        let name = "data.slf";
        let library_path = "";
        let entry_paths = ["foo.txt"];
        make_slf(&dir, &name, &library_path, &entry_paths);
        // foo.slf contains foo/bar.txt and foo/bar/baz.txt
        let name = "foo.slf";
        let library_path = "foo\\";
        let entry_paths = ["bar.txt", "bar\\baz.txt"];
        make_slf(&dir, &name, &library_path, &entry_paths);
        // foobar.slf contains foo/bar/baz.txt
        let name = "foobar.slf";
        let library_path = "foo\\bar\\";
        let entry_paths = ["baz.txt"];
        make_slf(&dir, &name, &library_path, &entry_paths);
        (tmp, dir)
    }
pub fn data_dir ( ) -> ( TempDir , PathBuf ) { let tmp = TempDir :: new ( ) . unwrap ( ) ; let dir = tmp . path ( ) . to_owned ( ) ; // data.slf contains foo.txt let name = " " ; let library_path = " " ; let entry_paths = [ " " ] ; make_slf ( & dir , & name , & library_path , & entry_paths ) ; // foo.slf contains foo/bar.txt and foo/bar/baz.txt let name = " " ; let library_path = " \\ " ; let entry_paths = [ " " , " \\ " ] ; make_slf ( & dir , & name , & library_path , & entry_paths ) ; // foobar.slf contains foo/bar/baz.txt let name = " " ; let library_path = " \\ \\ " ; let entry_paths = [ " " ] ; make_slf ( & dir , & name , & library_path , & entry_paths ) ; ( tmp , dir ) }
Creates a temporary data dir that is removed when TempDir is closed or goes out of scope.
Creates a temporary data dir that is removed when TempDir is closed or goes out of scope .