Hi all,
I keep getting these warnings where I defined a constant referenced it and the compiler tell's me that the constant is not used why?
You can see in the code below that the constant is used. At first rust-analyser warned me to make the the constant public don't know why
pub const IP_HDR_LEN_POS: usize = 0x0e;
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct PacketRef {
pub ts_sec: u32,
pub ts_usec: u32,
pub inc_len: u32,
pub orig_len: u32,
pub header_only: bool,
raw_packet: Vec<u8>,
vo: usize,
}
impl PacketRef {
...
pub fn _get_ip_header_len(&self) -> u8 {
let hdr_len = self.raw_packet[IP_HDR_LEN_POS];
(hdr_len >> 4) * 4
}
}