Skip to content

Commit

Permalink
feat: Use winver for Windows release version
Browse files Browse the repository at this point in the history
  • Loading branch information
peasee committed Sep 19, 2024
1 parent 2eae58d commit 6f04031
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ arrow = "51.0.0"
futures = "0.3.30"
base64 = "0.22.0"

[target.'cfg(windows)'.dependencies]
winver = "1.0.0"

[dev-dependencies]
regex = "1.10.6"
4 changes: 3 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ fn get_os_release() -> Result<String, Box<dyn std::error::Error>> {

#[cfg(target_family = "windows")]
fn get_os_release() -> Result<String, Box<dyn std::error::Error>> {
todo!("get_os_release not implemented for Windows")
use winver::WindowsVersion;
let version = WindowsVersion::get()?;
Ok(version.to_string())
}

pub(crate) fn get_user_agent() -> String {
Expand Down

0 comments on commit 6f04031

Please sign in to comment.