remove debugging
This commit is contained in:
parent
80c0f6b5b9
commit
5da5172c27
3 changed files with 7 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
|
From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
|
||||||
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
|
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
|
||||||
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;
|
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;,
|
||||||
Date: Sat, 20 Nov 2021 14:22:01 -0800
|
Date: Sat, 20 Nov 2021 14:22:01 -0800
|
||||||
Subject: Why not both importing AND exporting?
|
Subject: Why not both importing AND exporting?
|
||||||
Content-Type: multipart/mixed; boundary="festivus";
|
Content-Type: multipart/mixed; boundary="festivus";
|
||||||
|
|
|
@ -146,13 +146,11 @@ fn hex_octet(input: &[u8]) -> IResult<&[u8], u8> {
|
||||||
use nom::error::*;
|
use nom::error::*;
|
||||||
|
|
||||||
let (rest, hbytes) = preceded(tag("="), take(2usize))(input)?;
|
let (rest, hbytes) = preceded(tag("="), take(2usize))(input)?;
|
||||||
println!("TOOK: {:?}", hbytes);
|
|
||||||
|
|
||||||
let hstr = String::from_utf8_lossy(hbytes);
|
let hstr = String::from_utf8_lossy(hbytes);
|
||||||
let parsed = u8::from_str_radix(hstr.as_ref(), 16)
|
let parsed = u8::from_str_radix(hstr.as_ref(), 16)
|
||||||
.map_err(|_| nom::Err::Error(Error::new(input, ErrorKind::Verify)))?;
|
.map_err(|_| nom::Err::Error(Error::new(input, ErrorKind::Verify)))?;
|
||||||
|
|
||||||
println!("PARSED: {}", parsed);
|
|
||||||
Ok((rest, parsed))
|
Ok((rest, parsed))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ pub fn mime_word(input: &[u8]) -> IResult<&[u8], MIMEWord> {
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(PartialEq)]
|
||||||
pub enum Word<'a> {
|
pub enum Word<'a> {
|
||||||
Quoted(QuotedString<'a>),
|
Quoted(QuotedString<'a>),
|
||||||
Encoded(encoding::EncodedWord<'a>),
|
Encoded(encoding::EncodedWord<'a>),
|
||||||
|
@ -70,11 +70,11 @@ impl<'a> ToString for Word<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*impl<'a> fmt::Debug for Word<'a> {
|
impl<'a> fmt::Debug for Word<'a> {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
fmt.debug_tuple("Word").field(&format_args!("\"{}\"", self.to_string())).finish()
|
fmt.debug_tuple("Word").field(&format_args!("\"{}\"", self.to_string())).finish()
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/// Word
|
/// Word
|
||||||
///
|
///
|
||||||
|
@ -89,7 +89,7 @@ pub fn word(input: &[u8]) -> IResult<&[u8], Word> {
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(PartialEq)]
|
||||||
pub struct Phrase<'a>(pub Vec<Word<'a>>);
|
pub struct Phrase<'a>(pub Vec<Word<'a>>);
|
||||||
|
|
||||||
impl<'a> ToString for Phrase<'a> {
|
impl<'a> ToString for Phrase<'a> {
|
||||||
|
@ -101,11 +101,11 @@ impl<'a> ToString for Phrase<'a> {
|
||||||
.join(" ")
|
.join(" ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*impl<'a> fmt::Debug for Phrase<'a> {
|
impl<'a> fmt::Debug for Phrase<'a> {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
fmt.debug_tuple("Phrase").field(&format_args!("\"{}\"", self.to_string())).finish()
|
fmt.debug_tuple("Phrase").field(&format_args!("\"{}\"", self.to_string())).finish()
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/// Phrase
|
/// Phrase
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue