Skip to content

Commit

Permalink
Update kernel/src/scan/state.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Johnson <[email protected]>
  • Loading branch information
nicklan and scovich authored Jun 19, 2024
1 parent 18fe148 commit 8ab1482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/src/scan/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ impl<T> DataVisitor for ScanFileVisitor<'_, T> {
// Since path column is required, use it to detect presence of an Add action
if let Some(path) = getters[0].get_opt(row_index, "scanFile.path")? {
let size = getters[1].get(row_index, "scanFile.size")?;
let stats_json: Option<String> = getters[3].get_opt(row_index, "scanFile.stats")?;
let stats: Option<String> = getters[3].get_opt(row_index, "scanFile.stats")?;
let stats: Option<Stats> =
stats_json.and_then(|json| match serde_json::from_str(json.as_str()) {
stats.and_then(|json| match serde_json::from_str(json.as_str()) {
Ok(stats) => Some(stats),
Err(e) => {
warn!("Invalid stats string in Add file {json}: {}", e);
Expand Down

0 comments on commit 8ab1482

Please sign in to comment.