Skip to content

Commit 59b9e4c

Browse files
committed
chore(deps): update
1 parent b3bacfc commit 59b9e4c

3 files changed

Lines changed: 34 additions & 25 deletions

File tree

Cargo.lock

Lines changed: 20 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ struct Config {
2323
media_enable: bool,
2424
log_enable: bool,
2525
}
26-
26+
impl Default for Config {
27+
fn default() -> Self {
28+
Config {
29+
api_url: String::new(),
30+
api_key: String::new(),
31+
watch_time: 5,
32+
media_enable: true,
33+
log_enable: true,
34+
}
35+
}
36+
}
2737
async fn run_loop(config: Config) {
2838
let mut last_time = Utc::now();
2939
let mut previous_process_name = String::new();

src/reportprocess.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
* @Author: timochan
33
* @Date: 2023-07-17 13:50:34
44
* @LastEditors: timochan
5-
* @LastEditTime: 2023-07-27 20:32:00
5+
* @LastEditTime: 2023-10-11 07:56:54
66
* @FilePath: /processforlinux/src/reportprocess.rs
77
*/
88
use chrono::Utc;
99
use reqwest::{
1010
header::{self, HeaderValue},
1111
Client,
1212
};
13-
use serde_json::json;
13+
use serde_json::{self as json_self, json};
1414
use std::error::Error;
1515

1616
const USER_AGENT: &str = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 uacq";
@@ -57,7 +57,7 @@ pub async fn process_report(
5757
client
5858
.post(api_url)
5959
.headers(headers)
60-
.body(serde_json::to_string(&payload)?)
60+
.body(json_self::to_string(&payload)?)
6161
.send()
6262
.await?
6363
.text()

0 commit comments

Comments
 (0)