Debian Codegraph @

src/types.rs

raw symbols SCIP
1 use std::fmt;
2
3 pub struct Version {
4 pub major: usize,
5 pub minor: usize,
6 }
7
8 impl fmt::Display for Version {
9 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
10 write!(f, "{}.{}", self.major, self.minor)
11 }
12 }
13
14 pub struct LibcVersions {
15 pub glibc: Option<Version>,
16 pub musl: Option<Version>,
17 }
18
19 impl fmt::Display for LibcVersions {
20 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 let glibc_str = match &self.glibc {
22 Some(v) => format!("glibc {v}"),
23 None => "glibc <not detected>".to_string(),
24 };
25 let musl_str = match &self.musl {
26 Some(v) => format!("musl {v}"),
27 None => "musl <not detected>".to_string(),
28 };
29 write!(f, "{glibc_str} | {musl_str}")
30 }
31 }