v0.39.0
This commit is contained in:
1 parent
45b1fc04c7
commit
8b7f5dbfb8
21 files changed
+765
-413
No files matched your search
@@ -9,9 +9,10 @@ fn os_release() -> Option<&'static str> {
|
||||
VALUE
|
||||
.get_or_init(|| {
|
||||
sysinfo::System::long_os_version()
|
||||
.ok()
|
||||
.or_else(|| {
|
||||
let name = sysinfo::System::name()?;
|
||||
Some(match sysinfo::System::os_version() {
|
||||
let name = sysinfo::System::name().ok()?;
|
||||
Some(match sysinfo::System::os_version().ok() {
|
||||
Some(version) if !version.is_empty() => format!("{name} {version}"),
|
||||
_ => name,
|
||||
})
|
||||
@@ -24,7 +25,7 @@ fn os_release() -> Option<&'static str> {
|
||||
fn kernel_release() -> Option<&'static str> {
|
||||
static VALUE: std::sync::OnceLock<Option<String>> = std::sync::OnceLock::new();
|
||||
VALUE
|
||||
.get_or_init(|| sysinfo::System::kernel_version().and_then(valid_host_text))
|
||||
.get_or_init(|| sysinfo::System::kernel_version().ok().and_then(valid_host_text))
|
||||
.as_deref()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user