Skip to content

Commit f2d1bcb

Browse files
authored
Merge pull request #15 from VolumeGraphics/remove-unwraps
Remove unwraps
2 parents 5e13874 + 67e7b20 commit f2d1bcb

8 files changed

+24
-15
lines changed

clippy.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allow-unwrap-in-tests = true
2+
allow-expect-in-tests = true

config_scheme.json

+13
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,19 @@
287287
}
288288
},
289289
"additionalProperties": false
290+
},
291+
{
292+
"description": "PDF text compare",
293+
"type": "object",
294+
"required": [
295+
"PDFText"
296+
],
297+
"properties": {
298+
"PDFText": {
299+
"$ref": "#/definitions/HTMLCompareConfig"
300+
}
301+
},
302+
"additionalProperties": false
290303
}
291304
],
292305
"required": [

src/csv/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,6 @@ fn guess_format_from_reader<R: Read + Seek>(mut input: &mut R) -> Result<Delimit
532532
}
533533

534534
#[cfg(test)]
535-
#[allow(clippy::unwrap_used)]
536-
#[allow(clippy::expect_used)]
537535
mod tests {
538536
use super::*;
539537
use crate::csv::DiffType::{DifferentValueTypes, OutOfTolerance, UnequalStrings};

src/csv/preprocessing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ fn extract_headers(table: &mut Table) -> Result<(), csv::Error> {
141141
}
142142

143143
#[cfg(test)]
144-
#[allow(clippy::unwrap_used)]
145-
#[allow(clippy::expect_used)]
146144
mod tests {
147145
use super::*;
148146
use crate::csv::{Column, Delimiters, Error};

src/hash.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ pub enum HashFunction {
1818
/// Errors during hash checking
1919
pub enum Error {
2020
#[error("Failed to compile regex {0}")]
21-
RegexCompilationError(#[from] regex::Error),
21+
RegexCompilationFailed(#[from] regex::Error),
2222
#[error("Problem creating hash report {0}")]
23-
ReportingError(#[from] report::Error),
23+
ReportingFailure(#[from] report::Error),
2424
#[error("File access failed {0}")]
25-
FileAccessError(#[from] FatIOError),
25+
FileAccessProblem(#[from] FatIOError),
2626
}
2727

2828
impl HashFunction {

src/html.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ impl Default for HTMLCompareConfig {
4444
/// Errors during html / plain text checking
4545
pub enum Error {
4646
#[error("Failed to compile regex {0}")]
47-
RegexCompilationError(#[from] regex::Error),
47+
RegexCompilationFailure(#[from] regex::Error),
4848
#[error("Problem creating hash report {0}")]
49-
ReportingError(#[from] report::Error),
49+
ReportingProblem(#[from] report::Error),
5050
#[error("File access failed {0}")]
51-
FileAccessError(#[from] FatIOError),
51+
FileAccessFailure(#[from] FatIOError),
5252
}
5353

5454
pub fn compare_files<P: AsRef<Path>>(

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ pub fn get_schema() -> Result<String, Error> {
263263
}
264264

265265
#[cfg(test)]
266-
#[allow(clippy::unwrap_used)]
267-
#[allow(clippy::expect_used)]
268266
mod tests {
269267
use super::*;
270268
use crate::image::ImageCompareConfig;

src/pdf.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use vg_errortools::FatIOError;
1111
/// Errors during html / plain text checking
1212
pub enum Error {
1313
#[error("Failed to compile regex {0}")]
14-
RegexCompilationError(#[from] regex::Error),
14+
RegexCompilationFailure(#[from] regex::Error),
1515
#[error("Problem creating hash report {0}")]
16-
ReportingError(#[from] report::Error),
16+
ReportingFailure(#[from] report::Error),
1717
#[error("File access failed {0}")]
18-
FileAccessError(#[from] FatIOError),
18+
FileAccessProblem(#[from] FatIOError),
1919
#[error("PDF text extraction error {0}")]
2020
PdfTextExtractionFailed(#[from] pdf_extract::OutputError),
2121
}

0 commit comments

Comments
 (0)