From 4bebd7087a5829a1ed7d339c079b2ac37d8a8d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20L=C3=B6nnhager?= Date: Mon, 4 Sep 2023 10:42:03 +0200 Subject: [PATCH] fixup: N/A -> Windows N/A --- talpid-platform-metadata/src/windows.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/talpid-platform-metadata/src/windows.rs b/talpid-platform-metadata/src/windows.rs index 3e4fd1547c14..24515fa83eb9 100644 --- a/talpid-platform-metadata/src/windows.rs +++ b/talpid-platform-metadata/src/windows.rs @@ -13,6 +13,9 @@ use windows_sys::Win32::System::{ #[allow(non_camel_case_types)] type RTL_OSVERSIONINFOEXW = OSVERSIONINFOEXW; +const WINDOWS_UNKNOWN_STR: &str = "Windows N/A"; +const BUILD_UNKNOWN_STR: &str = "N/A"; + pub fn version() -> String { let (major, build) = WindowsVersion::new() .map(|version_info| { @@ -21,7 +24,7 @@ pub fn version() -> String { version_info.build_number().to_string(), ) }) - .unwrap_or_else(|_| ("N/A".to_string(), "N/A".to_string())); + .unwrap_or_else(|_| (WINDOWS_UNKNOWN_STR.to_owned(), BUILD_UNKNOWN_STR.to_owned())); format!("{} Build {}", major, build) } @@ -29,7 +32,7 @@ pub fn version() -> String { pub fn short_version() -> String { WindowsVersion::new() .map(|version| version.windows_version_string()) - .unwrap_or("Windows N/A".into()) + .unwrap_or(WINDOWS_UNKNOWN_STR.to_owned()) } pub fn extra_metadata() -> impl Iterator {