#Anything I can improve, particularly naming, in this 67 line code?
23 messages · Page 1 of 1 (latest)
i would honestly just spell everything out
The use renaming and the naming of each Error variant is weird to me. IDK.
except for the ip_addr and mac_addr
What do you mean?
this is fine
Are you sure? Is IoError a bit weird?
why is the variable named iface, instead of interface
no
Should I name my Error to ArpError or something? Then I'd have arp::ArpError but still.
no
this would warn if you enable pedantic https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
👍
as far as the api design goes, the error type could use some work. it is lacking context, so when an user gets your IoError variant, it doesnt actually have useful information. it doesn't say what it was trying to do when the error happened, for example
Would NoChannel work?
imagine if you wrote ```rust
#[derive(ThisError, Debug)]
pub enum Error {
#[error("lol fuck you")]
IoError(#[from] IoError),
}
I agree with you here, thought it was awkward too.
lmao
I might just make a ChannelError enum, then have an ArpError with a ChannelError variant holding the ChannelEnum
Because when I'm implementing an IpClient I'll have the same issue with channels.