Replace caret with num-derive, popularity.
I believe this would get tangled with #165 (closed).
The caret
create has sometimes 4 downloads a day, when num-derive
has thousands.
Effects tor-cell
.
[dependencies]
num-traits = "0.2"
num-derive = "0.3"
Note: Investigate NumCast
, NumOpt
makes no sense being math only and doesn't cover Ord
and Eq
.
use num_derive::{FromPrimitive, ToPrimitive};
https://fasterthanli.me/series/making-our-own-ping/part-11
#[derive(Debug, FromPrimitive, ToPrimitive)]
#[repr(u8)]
pub enum Protocol {
ICMP = 0x01,
TCP = 0x06,
UDP = 0x11,
}