Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::net::SocketAddrV4; not hand rolled parsing #20

Closed
emostov opened this issue May 20, 2022 · 1 comment
Closed

Use std::net::SocketAddrV4; not hand rolled parsing #20

emostov opened this issue May 20, 2022 · 1 comment

Comments

@emostov
Copy link
Contributor

emostov commented May 20, 2022

Instead of this:

qos/qos-host/src/cli.rs

Lines 69 to 76 in b862fb3

if let Some(cap) = iter.next() {
let ip1 = parse(&cap[1]);
let ip2 = parse(&cap[2]);
let ip3 = parse(&cap[3]);
let ip4 = parse(&cap[4]);
self.ip = Some([ip1, ip2, ip3, ip4]);
}

We can use this:

https://doc.rust-lang.org/std/net/struct.SocketAddrV4.html#method.from_str

For consistency, we should also standardize code apis to always take SocketAddrV4 and not ([u32, 4], u16)

@emostov
Copy link
Contributor Author

emostov commented Jun 15, 2022

Closed by #27

@emostov emostov closed this as completed Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant