Skip to content

Commit ffe447a

Browse files
stanislav-tkachspacekookie
authored andcommitted
Use os_info instead of os_type
1 parent 89664fb commit ffe447a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ uuid = { version = "0.8.0", features = ["v4"], default-features = false }
2121
serde_derive = "1.0.79"
2222
toml = "0.5.0"
2323
serde = "1.0.79"
24-
os_type = "2.2.0"
24+
os_info = "2.0.6"
2525
backtrace = "0.3.9"
2626

2727
[features]

src/report.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
use backtrace::Backtrace;
77
use serde_derive::Serialize;
8-
use std::borrow::Cow;
98
use std::error::Error;
109
use std::fmt::Write as FmtWrite;
1110
use std::mem;
@@ -26,7 +25,7 @@ pub enum Method {
2625
#[derive(Debug, Serialize)]
2726
pub struct Report {
2827
name: String,
29-
operating_system: Cow<'static, str>,
28+
operating_system: String,
3029
crate_version: String,
3130
explanation: String,
3231
cause: String,
@@ -43,12 +42,7 @@ impl Report {
4342
explanation: String,
4443
cause: String,
4544
) -> Self {
46-
let operating_system = if cfg!(windows) {
47-
"windows".into()
48-
} else {
49-
let platform = os_type::current_platform();
50-
format!("unix:{:?}", platform.os_type).into()
51-
};
45+
let operating_system = os_info::get().to_string();
5246

5347
//We skip 3 frames from backtrace library
5448
//Then we skip 3 frames for our own library

0 commit comments

Comments
 (0)