File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77#[ macro_use]
88extern crate log;
99#[ macro_use]
10- extern crate clap;
11- #[ macro_use]
1210extern crate lazy_static;
1311#[ macro_use]
1412extern crate serde_derive;
@@ -29,7 +27,7 @@ use std::str::FromStr;
2927use std:: thread;
3028use std:: time:: Duration ;
3129
32- use clap:: { App , Arg } ;
30+ use clap:: { Arg , Command } ;
3331use log:: LevelFilter ;
3432
3533use config:: config:: Config ;
@@ -49,23 +47,25 @@ lazy_static! {
4947}
5048
5149fn 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
Original file line number Diff line number Diff line change 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 ;
89use 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
You can’t perform that action at this time.
0 commit comments