MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / new

Method new

crates/chat-cli/src/os/diagnostics.rs:42–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41impl 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
59fn serialize_os_version<S>(version: &Option<&OSVersion>, serializer: S) -> Result<S::Ok, S::Error>

Callers

nothing calls this directly

Calls 11

os_versionFunction · 0.85
get_install_methodFunction · 0.85
in_sshFunction · 0.85
in_wslFunction · 0.85
brandMethod · 0.80
mapMethod · 0.80
current_dirMethod · 0.80
in_ciFunction · 0.50
in_codespacesFunction · 0.50
formatMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected