()
| 40 | |
| 41 | impl BuildDetails { |
| 42 | pub fn new() -> BuildDetails { |
| 43 | let date = crate::util::consts::build::DATETIME |
| 44 | .and_then(|input| OffsetDateTime::parse(input, &Rfc3339).ok()) |
| 45 | .and_then(|time| { |
| 46 | let rfc3339 = time.format(&Rfc3339).ok()?; |
| 47 | let duration = OffsetDateTime::now_utc() - time; |
| 48 | Some(format!("{rfc3339} ({duration:.0} ago)")) |
| 49 | }); |
| 50 | |
| 51 | BuildDetails { |
| 52 | version: env!("CARGO_PKG_VERSION").to_owned(), |
| 53 | hash: HASH, |
| 54 | date, |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | fn serialize_os_version<S>(version: &Option<&OSVersion>, serializer: S) -> Result<S::Ok, S::Error> |
nothing calls this directly
no test coverage detected