| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/; |
| 2 | |
| 3 | pub struct Versionrust-analyzer cargo glibc_musl_version 0.1.0 types/Version# { |
| 4 | pub majorrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#major.: usize, |
| 5 | pub minorrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#minor.: usize, |
| 6 | } |
| 7 | |
| 8 | impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Versionrust-analyzer cargo glibc_musl_version 0.1.0 types/Version# { |
| 9 | fn fmtrust-analyzer cargo glibc_musl_version 0.1.0 types/impl#[Version][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 10 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}.{}", self.majorrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#major., self.minorrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#minor.) |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | pub struct LibcVersionsrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions# { |
| 15 | pub glibcrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions#glibc.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#>, |
| 16 | pub muslrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions#musl.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo glibc_musl_version 0.1.0 types/Version#>, |
| 17 | } |
| 18 | |
| 19 | impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for LibcVersionsrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions# { |
| 20 | fn fmtrust-analyzer cargo glibc_musl_version 0.1.0 types/impl#[LibcVersions][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 21 | let glibc_str = match &self.glibcrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions#glibc. { |
| 22 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(v) => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("glibc {v}"), |
| 23 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => "glibc <not detected>".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 24 | }; |
| 25 | let musl_str = match &self.muslrust-analyzer cargo glibc_musl_version 0.1.0 types/LibcVersions#musl. { |
| 26 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(v) => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("musl {v}"), |
| 27 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => "musl <not detected>".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 28 | }; |
| 29 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{glibc_str} | {musl_str}") |
| 30 | } |
| 31 | } |