diff --git a/src/mime/field.rs b/src/mime/field.rs index 0b93206..04d0c61 100644 --- a/src/mime/field.rs +++ b/src/mime/field.rs @@ -20,6 +20,7 @@ pub enum Content<'a> { ID(MessageID<'a>), Description(Unstructured<'a>), } +#[allow(dead_code)] impl<'a> Content<'a> { pub fn ctype(&'a self) -> Option<&'a NaiveType<'a>> { match self { diff --git a/src/mime/type.rs b/src/mime/type.rs index 383e584..579d7f0 100644 --- a/src/mime/type.rs +++ b/src/mime/type.rs @@ -1,5 +1,5 @@ use nom::{ - bytes::complete::{is_not, tag}, + bytes::complete::{tag}, combinator::{map, opt}, multi::many0, sequence::{preceded, terminated, tuple}, @@ -9,7 +9,6 @@ use nom::{ use crate::mime::charset::EmailCharset; use crate::text::misc_token::{mime_word, MIMEWord}; use crate::text::words::mime_atom; -use crate::text::ascii; // --------- NAIVE TYPE #[derive(Debug, PartialEq)] diff --git a/src/part/part.rs b/src/part/part.rs index a896406..7a31ae7 100644 --- a/src/part/part.rs +++ b/src/part/part.rs @@ -62,6 +62,7 @@ pub enum MixedField<'a> { MIME(mime::field::Content<'a>), IMF(imf::field::Field<'a>), } +#[allow(dead_code)] impl<'a> MixedField<'a> { pub fn mime(&self) -> Option<&mime::field::Content<'a>> { match self { diff --git a/src/text/ascii.rs b/src/text/ascii.rs index b59647b..9f37738 100644 --- a/src/text/ascii.rs +++ b/src/text/ascii.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + // ASCII // -- CONTROL CHARACTERS pub const NULL: u8 = 0x00; // NULL diff --git a/src/text/whitespace.rs b/src/text/whitespace.rs index be0747d..66c7e5c 100644 --- a/src/text/whitespace.rs +++ b/src/text/whitespace.rs @@ -25,13 +25,6 @@ pub fn obs_crlf(input: &[u8]) -> IResult<&[u8], &[u8]> { alt((tag(ascii::CRLF), tag(&[ascii::CR]), tag(&[ascii::LF])))(input) } -pub fn line(input: &[u8]) -> IResult<&[u8], (&[u8], &[u8])> { - // is_not(CRLF) is a hack, it means "is not CR or LF" - // and not "is not CRLF". In other words, it continues while - // it does not encounter 0x0D or 0x0A. - pair(is_not(ascii::CRLF), obs_crlf)(input) -} - /// ```abnf /// fold_line = any *(1*(crlf WS) any) crlf /// ``` diff --git a/src/text/words.rs b/src/text/words.rs index 6e19aaa..8cd2ce8 100644 --- a/src/text/words.rs +++ b/src/text/words.rs @@ -90,6 +90,7 @@ pub fn dot_atom_text(input: &[u8]) -> IResult<&[u8], &[u8]> { /// dot-atom /// /// `[CFWS] dot-atom-text [CFWS]` +#[allow(dead_code)] pub fn dot_atom(input: &[u8]) -> IResult<&[u8], &[u8]> { delimited(opt(cfws), dot_atom_text, opt(cfws))(input) }