Skip to content

Commit

Permalink
Add documentation of newly exposed structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Regali committed Jul 25, 2023
1 parent f530270 commit 83c32c6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/csv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,52 @@ pub enum Error {
UnequalRowCount(usize, usize),
}

/// A position inside a table
#[derive(Clone, Copy, Debug, Serialize)]
pub struct Position {
/// row number, starting with zero
pub row: usize,
/// column number, starting with zero
pub col: usize,
}

#[derive(Debug, Serialize, Clone)]
/// Difference of a table entry
pub enum DiffType {
/// Both entries were strings, but had different contents
UnequalStrings {
/// nominal string
nominal: String,
/// actual string
actual: String,
/// position
position: Position,
},
/// Both entries were [`Quantity`]s but exceeded tolerances
OutOfTolerance {
/// nominal
nominal: Quantity,
/// actual
actual: Quantity,
/// compare mode that was exceeded
mode: Mode,
/// position in table
position: Position,
},
/// both fields had different value types
DifferentValueTypes {
/// nominal
nominal: Value,
/// actual
actual: Value,
/// position
position: Position,
},
/// Both fields were headers but with different contents
UnequalHeader {
/// nominal
nominal: String,
/// actual
actual: String,
},
}
Expand Down
5 changes: 3 additions & 2 deletions src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ fn file_modification_time_out_of_tolerance(
result.is_error = true;
}
} else {
let msg = format!("Could not calculate duration between modification timestamps");
let msg =
"Could not calculate duration between modification timestamps".to_string();
error!("{}", &msg);
result.push_detail(DiffDetail::Error(msg));
result.is_error = true;
}
} else {
let msg = format!("Could not read file modification timestamps");
let msg = "Could not read file modification timestamps".to_string();
error!("{}", &msg);
result.push_detail(DiffDetail::Error(msg));
result.is_error = true;
Expand Down

0 comments on commit 83c32c6

Please sign in to comment.