(value: Option<&Value>)
| 317 | } |
| 318 | |
| 319 | fn timestamp_value(value: Option<&Value>) -> Option<crate::TimestampMs> { |
| 320 | match value? { |
| 321 | Value::String(value) => parse_ts_timestamp(value), |
| 322 | Value::Number(value) => { |
| 323 | let raw = value.as_i64()?; |
| 324 | let millis = if raw < 10_000_000_000 { |
| 325 | raw.checked_mul(1_000)? |
| 326 | } else { |
| 327 | raw |
| 328 | }; |
| 329 | (millis > 0).then(|| crate::TimestampMs::from_millis(millis)) |
| 330 | } |
| 331 | _ => None, |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | fn file_modified_timestamp(path: &Path) -> Option<crate::TimestampMs> { |
| 336 | let modified = fs::metadata(path).ok()?.modified().ok()?; |
no test coverage detected