Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Grimpy101 committed Jul 1, 2023
1 parent d9f57c9 commit 8b3d026
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
37 changes: 0 additions & 37 deletions bvp-converters/src/lib/archives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,6 @@ pub enum ArchiveEnum {
}

impl ArchiveEnum {
/// Takes the type of archive to use and writes files.
/// * `files` - a vector of files to write
/// * `output_filepath` - a filepath to write to; should be a file in case of archive or a folder in case of unarchived output
pub fn write_files(&self, files: &Vec<File>, output_filepath: String) -> Result<(), ArchiveError> {
match self {
Self::SAF => {
let saf = match saf::to_saf_archive(files) {
Ok(s) => s,
Err(e) => return Err(ArchiveError::SafError(e))
};
match fs::write(output_filepath, saf) {
Ok(_) => (),
Err(e) => return Err(ArchiveError::CannotWrite(e.to_string()))
};
},
Self::ZIP => {
let zip = match zip::to_zip_archive(files) {
Ok(z) => z,
Err(e) => return Err(ArchiveError::ZipError(e))
};
match fs::write(output_filepath, zip) {
Ok(_) => (),
Err(e) => return Err(ArchiveError::CannotWrite(e.to_string()))
}
},
Self::None => {
for file in files {
match file.write() {
Ok(_) => (),
Err(e) => return Err(ArchiveError::CannotWrite(e.to_string()))
};
}
}
};
return Ok(());
}

pub fn return_writer(&self) -> Box<dyn ArchiveWriter + Send> {
match self {
Self::SAF => {
Expand Down
2 changes: 1 addition & 1 deletion bvp-converters/src/raw_to_bvp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod sequential;

use std::fs;
pub use parallel::raw_to_bvp_parallel;
pub use sequential::raw_to_bvp_sequential;
//pub use sequential::raw_to_bvp_sequential;

fn read_input_file(filepath: &str) -> Result<Vec<u8>, String> {
match fs::read(filepath) {
Expand Down
3 changes: 2 additions & 1 deletion bvp-converters/src/raw_to_bvp/sequential.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::sync::Arc;
/*use std::sync::Arc;
use xxhash_rust::xxh3;
use bvp::block::Block;
use bvp::bvpfile::BVPFile;
Expand Down Expand Up @@ -120,3 +120,4 @@ pub fn raw_to_bvp_sequential(
Ok(())
}
*/

0 comments on commit 8b3d026

Please sign in to comment.