Skip to content

Commit 75860c7

Browse files
Fix breaking changes
1 parent 1bbf566 commit 75860c7

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/main.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#[macro_use]
88
extern crate log;
99
#[macro_use]
10-
extern crate clap;
11-
#[macro_use]
1210
extern crate lazy_static;
1311
#[macro_use]
1412
extern crate serde_derive;
@@ -29,7 +27,7 @@ use std::str::FromStr;
2927
use std::thread;
3028
use std::time::Duration;
3129

32-
use clap::{App, Arg};
30+
use clap::{Arg, Command};
3331
use log::LevelFilter;
3432

3533
use config::config::Config;
@@ -49,23 +47,25 @@ lazy_static! {
4947
}
5048

5149
fn make_app_args() -> AppArgs {
52-
let matches = App::new(crate_name!())
53-
.version(crate_version!())
54-
.author(crate_authors!("\n"))
55-
.about(crate_description!())
50+
let matches = Command::new(clap::crate_name!())
51+
.version(clap::crate_version!())
52+
.author(clap::crate_authors!())
53+
.about(clap::crate_description!())
5654
.arg(
5755
Arg::new("config")
5856
.short('c')
5957
.long("config")
6058
.help("Path to configuration file")
61-
.default_value("./config.cfg")
62-
.takes_value(true),
59+
.default_value("./config.cfg"),
6360
)
6461
.get_matches();
6562

6663
// Generate owned app arguments
6764
AppArgs {
68-
config: String::from(matches.value_of("config").expect("invalid config value")),
65+
config: matches
66+
.get_one::<String>("config")
67+
.expect("invalid config value")
68+
.to_owned(),
6969
}
7070
}
7171

src/probe/report.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// Copyright: 2018, Crisp IM SAS
55
// License: Mozilla Public License v2.0 (MPL v2.0)
66

7-
use base64;
7+
use base64::engine::general_purpose::STANDARD as base64_encoder;
8+
use base64::Engine;
89
use http_req::{
910
request::{Method, Request},
1011
uri::Uri,
@@ -39,7 +40,7 @@ lazy_static! {
3940
format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
4041
pub static ref REPORT_HTTP_HEADER_AUTHORIZATION: String = format!(
4142
"Basic {}",
42-
base64::encode(&format!(":{}", APP_CONF.report.token))
43+
base64_encoder.encode(&format!(":{}", APP_CONF.report.token))
4344
);
4445
}
4546

0 commit comments

Comments
 (0)