@@ -76,7 +76,7 @@ fn de_from_hex<'de, D>(deserializer: D) -> Result<PublicKey, D::Error> where D:
76
76
let bootstrap_pk_bytes: [ u8 ; 32 ] = FromHex :: from_hex ( s)
77
77
. map_err ( |e| de:: Error :: custom ( format ! ( "Can't make bytes from hex string {:?}" , e) ) ) ?;
78
78
PublicKey :: from_slice ( & bootstrap_pk_bytes)
79
- . ok_or ( de:: Error :: custom ( "Can't make PublicKey" ) )
79
+ . ok_or_else ( || de:: Error :: custom ( "Can't make PublicKey" ) )
80
80
}
81
81
82
82
// TODO: Remove this function. Use default String type after bug fix released.
@@ -259,18 +259,18 @@ pub fn cli_parse() -> NodeConfig {
259
259
}
260
260
261
261
/// Parse settings from a saved file.
262
- fn parse_config ( config_path : String ) -> NodeConfig {
262
+ fn parse_config ( config_path : & str ) -> NodeConfig {
263
263
let mut settings = Config :: default ( ) ;
264
264
265
265
settings. set_default ( "log-type" , "Stderr" ) . expect ( "Can't set default value for `log-type`" ) ;
266
266
settings. set_default ( "motd" , "This is tox-rs" ) . expect ( "Can't set default value for `motd`" ) ;
267
267
settings. set_default ( "lan-discovery" , "False" ) . expect ( "Can't set default value for `lan-discovery`" ) ;
268
268
settings. set_default ( "threads" , "1" ) . expect ( "Can't set default value for `threads`" ) ;
269
269
270
- let config_file = if !Path :: new ( & config_path) . exists ( ) {
270
+ let config_file = if !Path :: new ( config_path) . exists ( ) {
271
271
panic ! ( "Can't find config file {}" , config_path) ;
272
272
} else {
273
- CfgFile :: with_name ( & config_path)
273
+ CfgFile :: with_name ( config_path)
274
274
} ;
275
275
276
276
settings. merge ( config_file) . expect ( "Merging config file with default values failed" ) ;
@@ -287,7 +287,7 @@ fn parse_config(config_path: String) -> NodeConfig {
287
287
fn run_config ( matches : & ArgMatches ) -> NodeConfig {
288
288
let config_path = value_t ! ( matches. value_of( "cfg-file" ) , String ) . unwrap_or_else ( |e| e. exit ( ) ) ;
289
289
290
- parse_config ( config_path)
290
+ parse_config ( & config_path)
291
291
}
292
292
293
293
fn run_args ( matches : & ArgMatches ) -> NodeConfig {
0 commit comments