Skip to content

Commit

Permalink
feat(rust): change dependency from os_type to os info (#558)
Browse files Browse the repository at this point in the history
Signed-off-by: SSpirits <[email protected]>
  • Loading branch information
ShadowySpirits committed Jul 3, 2023
1 parent 5aed664 commit 7fa131f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions rust/.cargo/Cargo.lock.min

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ thiserror = "1.0"
anyhow = "1.0.70"
parking_lot = "0.12"
hostname = "0.3.1"
os_type = "2.6.0"
os_info = "3"

slog = {version = "2.7.0", features=["max_level_trace", "release_max_level_info"]}
slog-term = "2.9.0"
Expand Down
8 changes: 4 additions & 4 deletions rust/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub(crate) fn build_producer_settings(
resource_namespace: option.namespace().to_string(),
})
.collect();
let platform = os_type::current_platform();
let platform = os_info::get();
TelemetryCommand {
command: Some(Command::Settings(Settings {
client_type: Some(client_options.client_type.clone() as i32),
Expand All @@ -115,7 +115,7 @@ pub(crate) fn build_producer_settings(
user_agent: Some(Ua {
language: SDK_LANGUAGE as i32,
version: SDK_VERSION.to_string(),
platform: format!("{:?} {}", platform.os_type, platform.version),
platform: format!("{} {}", platform.os_type(), platform.version()),
hostname: HOST_NAME.clone(),
}),
..Settings::default()
Expand All @@ -128,7 +128,7 @@ pub(crate) fn build_simple_consumer_settings(
option: &SimpleConsumerOption,
client_option: &ClientOption,
) -> TelemetryCommand {
let platform = os_type::current_platform();
let platform = os_info::get();
TelemetryCommand {
command: Some(Command::Settings(Settings {
client_type: Some(client_option.client_type.clone() as i32),
Expand All @@ -152,7 +152,7 @@ pub(crate) fn build_simple_consumer_settings(
user_agent: Some(Ua {
language: SDK_LANGUAGE as i32,
version: SDK_VERSION.to_string(),
platform: format!("{:?} {}", platform.os_type, platform.version),
platform: format!("{} {}", platform.os_type(), platform.version()),
hostname: HOST_NAME.clone(),
}),
..Settings::default()
Expand Down

0 comments on commit 7fa131f

Please sign in to comment.