mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 22:43:26 -08:00
chore: Use default error handler in rp main()
This commit is contained in:
@@ -10,7 +10,7 @@ mod exchange;
|
|||||||
mod key;
|
mod key;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() -> anyhow::Result<()> {
|
||||||
#[cfg(feature = "experiment_memfd_secret")]
|
#[cfg(feature = "experiment_memfd_secret")]
|
||||||
policy::secret_policy_try_use_memfd_secrets();
|
policy::secret_policy_try_use_memfd_secrets();
|
||||||
#[cfg(not(feature = "experiment_memfd_secret"))]
|
#[cfg(not(feature = "experiment_memfd_secret"))]
|
||||||
@@ -26,7 +26,7 @@ async fn main() {
|
|||||||
|
|
||||||
let command = cli.command.unwrap();
|
let command = cli.command.unwrap();
|
||||||
|
|
||||||
let res = match command {
|
match command {
|
||||||
Command::GenKey { private_keys_dir } => genkey(&private_keys_dir),
|
Command::GenKey { private_keys_dir } => genkey(&private_keys_dir),
|
||||||
Command::PubKey {
|
Command::PubKey {
|
||||||
private_keys_dir,
|
private_keys_dir,
|
||||||
@@ -47,13 +47,5 @@ async fn main() {
|
|||||||
println!("Usage: rp [verbose] genkey|pubkey|exchange [ARGS]...");
|
println!("Usage: rp [verbose] genkey|pubkey|exchange [ARGS]...");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
match res {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(err) => {
|
|
||||||
eprintln!("An error occurred: {}", err);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user