dchat: quick cleanup

This commit is contained in:
lunar-mining
2022-07-31 08:53:17 +02:00
parent ba7a5cc21b
commit 0e20fa2e6d
2 changed files with 3 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ pub struct MissingSpecifier;
impl fmt::Display for MissingSpecifier {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "missing node specifier")
write!(f, "missing node specifier. you must specify either a or b")
}
}

View File

@@ -301,20 +301,13 @@ async fn main() -> Result<()> {
let file = File::create(log_path).unwrap();
WriteLogger::init(log_level, log_config, file)?;
// TODO:: proper error handling
let settings: Result<Settings> = match std::env::args().nth(1) {
Some(id) => match id.as_str() {
"a" => alice(),
"b" => bob(),
_ => {
println!("you must specify either a or b");
Err(MissingSpecifier.into())
}
_ => Err(MissingSpecifier.into()),
},
None => {
println!("you must specify either a or b");
Err(MissingSpecifier.into())
}
None => Err(MissingSpecifier.into()),
};
let p2p = net::P2p::new(settings?.into()).await;