Skip to content
This repository was archived by the owner on Jun 12, 2026. It is now read-only.

Commit bdc5496

Browse files
author
yggverse
committed
require valid SocketAddr
1 parent 91186b8 commit bdc5496

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/argument.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
use clap::Parser;
2-
use std::path::PathBuf;
2+
use std::{
3+
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
4+
path::PathBuf,
5+
};
36

47
#[derive(Parser, Debug)]
58
#[command(version, about, long_about = None)]
69
pub struct Argument {
710
/// Bind server `host:port` to listen incoming connections on it
8-
#[arg(short, long, default_value_t = std::net::SocketAddrV4::new(std::net::Ipv4Addr::LOCALHOST, 1965).to_string())]
9-
pub bind: String,
11+
#[arg(short, long, default_value_t = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, 1965)))]
12+
pub bind: SocketAddr,
1013

1114
/// Filepath to server identity in PKCS (PFX) format
1215
#[arg(short, long)]

0 commit comments

Comments
 (0)