forked from mirror/async-std
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
400 B
Rust
14 lines
400 B
Rust
5 years ago
|
mod client;
|
||
|
mod server;
|
||
|
|
||
|
type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
|
||
|
|
||
|
fn main() -> Result<()> {
|
||
|
let mut args = std::env::args();
|
||
|
match (args.nth(1).as_ref().map(String::as_str), args.next()) {
|
||
|
(Some("client"), None) => client::main(),
|
||
|
(Some("server"), None) => server::main(),
|
||
|
_ => Err("Usage: a-chat [client|server]")?,
|
||
|
}
|
||
|
}
|