Skip to content

Commit

Permalink
Remove clap from simple example
Browse files Browse the repository at this point in the history
Update criterion and clap
  • Loading branch information
BlackHoleFox authored and mcginty committed Jan 13, 2024
1 parent 4cd77c5 commit 02c26b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ sodiumoxide = { version = "0.2", optional = true }
byteorder = { version = "1.4", optional = true }

[dev-dependencies]
clap = "3"
criterion = "0.3"
criterion = "0.5"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
Expand Down
7 changes: 3 additions & 4 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
//! as `cargo run --example simple` to see the magic happen.
use lazy_static::lazy_static;

use clap::{arg, App};
use snow::{params::NoiseParams, Builder};
use std::{
io::{self, Read, Write},
Expand All @@ -25,9 +23,10 @@ lazy_static! {

#[cfg(any(feature = "default-resolver", feature = "ring-accelerated"))]
fn main() {
let matches = App::new("simple").arg(arg!("-s --server 'Server mode'")).get_matches();
let server_mode =
std::env::args().next_back().map(|arg| arg == "-s" || arg == "--server").unwrap_or(true);

if matches.is_present("server") {
if server_mode {
run_server();
} else {
run_client();
Expand Down

0 comments on commit 02c26b7

Please sign in to comment.