Skip to content

Commit

Permalink
use clap to enforce socketaddr in example
Browse files Browse the repository at this point in the history
  • Loading branch information
davethiede committed Aug 5, 2023
1 parent 110af90 commit 04fde5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/udptest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde_json::Value;
use std::net::UdpSocket;
use std::net::{SocketAddr, UdpSocket};

use clap::{Parser, ValueEnum};
use serde_json::Value;

#[derive(Debug, ValueEnum, Clone, Parser)]
enum Mode {
Expand All @@ -27,7 +27,7 @@ struct Arg {

/// Listen addr:port
#[clap(long, short, default_value = "0.0.0.0:50222")]
addr: String,
addr: SocketAddr,

/// Display mode.
///
Expand Down

0 comments on commit 04fde5c

Please sign in to comment.