Skip to content

Commit

Permalink
Merge pull request #15 from VolumeGraphics/remove-unwraps
Browse files Browse the repository at this point in the history
Remove unwraps
  • Loading branch information
ChrisRega committed Dec 9, 2022
2 parents 5e13874 + 67e7b20 commit f2d1bcb
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 15 deletions.
2 changes: 2 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allow-unwrap-in-tests = true
allow-expect-in-tests = true
13 changes: 13 additions & 0 deletions config_scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,19 @@
}
},
"additionalProperties": false
},
{
"description": "PDF text compare",
"type": "object",
"required": [
"PDFText"
],
"properties": {
"PDFText": {
"$ref": "#/definitions/HTMLCompareConfig"
}
},
"additionalProperties": false
}
],
"required": [
Expand Down
2 changes: 0 additions & 2 deletions src/csv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,6 @@ fn guess_format_from_reader<R: Read + Seek>(mut input: &mut R) -> Result<Delimit
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::expect_used)]
mod tests {
use super::*;
use crate::csv::DiffType::{DifferentValueTypes, OutOfTolerance, UnequalStrings};
Expand Down
2 changes: 0 additions & 2 deletions src/csv/preprocessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ fn extract_headers(table: &mut Table) -> Result<(), csv::Error> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::expect_used)]
mod tests {
use super::*;
use crate::csv::{Column, Delimiters, Error};
Expand Down
6 changes: 3 additions & 3 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub enum HashFunction {
/// Errors during hash checking
pub enum Error {
#[error("Failed to compile regex {0}")]
RegexCompilationError(#[from] regex::Error),
RegexCompilationFailed(#[from] regex::Error),
#[error("Problem creating hash report {0}")]
ReportingError(#[from] report::Error),
ReportingFailure(#[from] report::Error),
#[error("File access failed {0}")]
FileAccessError(#[from] FatIOError),
FileAccessProblem(#[from] FatIOError),
}

impl HashFunction {
Expand Down
6 changes: 3 additions & 3 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ impl Default for HTMLCompareConfig {
/// Errors during html / plain text checking
pub enum Error {
#[error("Failed to compile regex {0}")]
RegexCompilationError(#[from] regex::Error),
RegexCompilationFailure(#[from] regex::Error),
#[error("Problem creating hash report {0}")]
ReportingError(#[from] report::Error),
ReportingProblem(#[from] report::Error),
#[error("File access failed {0}")]
FileAccessError(#[from] FatIOError),
FileAccessFailure(#[from] FatIOError),
}

pub fn compare_files<P: AsRef<Path>>(
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ pub fn get_schema() -> Result<String, Error> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::expect_used)]
mod tests {
use super::*;
use crate::image::ImageCompareConfig;
Expand Down
6 changes: 3 additions & 3 deletions src/pdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use vg_errortools::FatIOError;
/// Errors during html / plain text checking
pub enum Error {
#[error("Failed to compile regex {0}")]
RegexCompilationError(#[from] regex::Error),
RegexCompilationFailure(#[from] regex::Error),
#[error("Problem creating hash report {0}")]
ReportingError(#[from] report::Error),
ReportingFailure(#[from] report::Error),
#[error("File access failed {0}")]
FileAccessError(#[from] FatIOError),
FileAccessProblem(#[from] FatIOError),
#[error("PDF text extraction error {0}")]
PdfTextExtractionFailed(#[from] pdf_extract::OutputError),
}
Expand Down

0 comments on commit f2d1bcb

Please sign in to comment.