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

Function serialize_os_version

crates/chat-cli/src/os/diagnostics.rs:59–70  ·  view source on GitHub ↗
(version: &Option<&OSVersion>, serializer: S)

Source from the content-addressed store, hash-verified

57}
58
59fn serialize_os_version<S>(version: &Option<&OSVersion>, serializer: S) -> Result<S::Ok, S::Error>
60where
61 S: serde::Serializer,
62{
63 match version {
64 Some(version) => match version {
65 OSVersion::Linux { .. } => version.serialize(serializer),
66 other => serializer.serialize_str(&other.to_string()),
67 },
68 None => serializer.serialize_none(),
69 }
70}
71
72#[derive(Debug, Clone, Serialize)]
73#[serde(rename_all = "kebab-case")]

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
serializeMethod · 0.45

Tested by

no test coverage detected