You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
let current_flags = match toml::to_string(globals){
298
-
Ok(x) => x,
299
-
Err(_) => returnErr(ArgsError::ConfigWriteError("Failed to generate valid config toml from current flags. Please report a bug if this error persists.".to_owned())),
300
-
};
301
-
302
-
ifletErr(_) = fs::write(&path, current_flags){
303
-
returnErr(ArgsError::ConfigParseError(format!("Failed to write config to given file path: {}. Please try again with a valid path and config name.",&path)));
304
-
};
296
+
let current_flags = toml::to_string(globals).map_err(|e| {
297
+
ArgsError::ConfigWriteError(format!(
298
+
"Failed to generate valid config toml from current flags: {}.Please report a bug if this error persists.", e
299
+
))
300
+
})?;
301
+
302
+
fs::write(&path, current_flags).map_err(|_| {
303
+
ArgsError::ConfigParseError(format!(
304
+
"Failed to write config to given file path {}. Please try again with a valid path and config name.",&path
305
+
))
306
+
})?;
305
307
}
306
308
Ok(())
307
309
}
@@ -314,40 +316,35 @@ impl Args {
314
316
let default_config_file:String = get_config(default_config_path)?;
315
317
let fallback_config_file:String = get_config(fallback_config_path)?;
316
318
317
-
let default_config:Globals = match toml::from_str(&default_config_file){
318
-
Ok(x) => x,
319
-
Err(e) => {
320
-
returnErr(ArgsError::ConfigParseError(format!(
321
-
"Failure to parse config file: {}, error: {}",
322
-
default_config_path, e
323
-
)))
324
-
}
325
-
};
326
-
let fallback_config:Globals = match toml::from_str(&fallback_config_file){
327
-
Ok(x) => x,
328
-
Err(_) => {
329
-
returnErr(ArgsError::ConfigParseError(format!(
330
-
"Failure to parse config file: {}",
331
-
fallback_config_path
332
-
)))
333
-
}
334
-
};
319
+
let default_config:Globals = toml::from_str(&default_config_file).map_err(|e| {
320
+
ArgsError::ConfigParseError(format!(
321
+
"Failure to parse config file: {}, error: {}",
322
+
default_config_path, e
323
+
))
324
+
})?;
325
+
326
+
let fallback_config:Globals = toml::from_str(&fallback_config_file).map_err(|e| {
Copy file name to clipboardExpand all lines: parity/cli/subcommands.rs
-19Lines changed: 0 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,11 @@ pub enum SubCommands {
20
20
Signer(Signer),
21
21
Snapshots(Snapshots),
22
22
Restore(Restore),
23
-
Tools(Tools),
24
23
Db(Db),
25
24
#[structopt(
26
25
about = "Print the hashed light clients headers of the given --chain (default: mainnet) in a JSON format. To be used as hardcoded headers in a genesis file."
27
26
)]
28
27
ExportHardcodedSync,
29
-
Dapp(Dapp),
30
28
}
31
29
32
30
#[derive(StructOpt,Deserialize,Debug,Clone)]
@@ -208,16 +206,6 @@ pub struct Restore {
208
206
pubfile:Option<String>,
209
207
}
210
208
211
-
#[derive(StructOpt,Deserialize,Debug,Clone)]
212
-
#[structopt(about = "Tools")]
213
-
pubenumTools{
214
-
#[structopt(about = "Hash a file using the Keccak-256 algorithm")]
215
-
Hash{
216
-
#[structopt(name = "FILE")]
217
-
file:Option<String>,
218
-
},
219
-
}
220
-
221
209
#[derive(StructOpt,Deserialize,Debug,Clone)]
222
210
#[structopt(about = "Manage the Database representing the state of the blockchain on this system")]
223
211
pubenumDb{
@@ -233,10 +221,3 @@ pub enum Db {
233
221
num:u32,
234
222
},
235
223
}
236
-
237
-
#[derive(StructOpt,Deserialize,Debug,Clone)]
238
-
#[structopt(about = "Manage Dapps")]
239
-
pubstructDapp{
240
-
#[structopt(help = "Path to the dapps", name = "PATH")]
0 commit comments