1
0
mirror of https://github.com/pcvolkmer/fastq-tools.git synced 2025-09-13 13:12:52 +00:00

Compare commits

1 Commits

Author SHA1 Message Date
abd587d50f refactor: remove path prefix 2025-09-11 21:00:16 +02:00

View File

@@ -1,6 +1,6 @@
use crate::fastq::{Header, Pair};
use crate::input_reader;
use crate::metadata_file::MetadataError::{CannotReadFile, ReadError};
use crate::metadata_file::MetadataError::{CannotReadFile, ReadError, UnsupportedFile};
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
@@ -96,9 +96,9 @@ impl Display for MetadataError {
f,
"{}",
match self {
MetadataError::CannotReadFile => "Cannot read file".into(),
MetadataError::UnsupportedFile => "Unsupported file type".into(),
MetadataError::ReadError(err) => format!("Error reading file: {}", err),
CannotReadFile => "Cannot read file".into(),
UnsupportedFile => "Unsupported file type".into(),
ReadError(err) => format!("Error reading file: {}", err),
}
)
}
@@ -110,7 +110,7 @@ impl MetadataFile {
pub fn read_file(path: PathBuf, decompress: bool) -> Result<MetadataFile, MetadataError> {
let path = match path.to_str() {
Some(path) => path,
None => return Err(MetadataError::CannotReadFile),
None => return Err(CannotReadFile),
};
let file = File::open(path).map_err(|_| CannotReadFile)?;
@@ -126,7 +126,7 @@ impl MetadataFile {
{
FileType::Fastq
} else {
return Err(MetadataError::UnsupportedFile);
return Err(UnsupportedFile);
};
let file_checksum = match fs::read(path) {