mirror of
https://github.com/stalwartlabs/mail-parser.git
synced 2026-11-29 00:01:49 +00:00
Bump to hashify 0.3
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
resolver = "2"
|
||||
|
||||
[dependencies]
|
||||
hashify = { version = "0.2" }
|
||||
hashify = { version = "0.3" }
|
||||
memchr = { version = "2.7", optional = true }
|
||||
encoding_rs = { version = "0.8", optional = true }
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
||||
@@ -22,7 +22,7 @@ pub fn charset_decoder(charset: &[u8]) -> Option<DecoderFnc> {
|
||||
};
|
||||
}
|
||||
|
||||
hashify::tiny_map!(&l_charset[..charset.len().clamp(1, 45)],
|
||||
hashify::map!(&l_charset[..charset.len().clamp(1, 45)], DecoderFnc,
|
||||
"850" => decoder_ibm_850,
|
||||
"866" => decoder_ibm866,
|
||||
"ansi_x3.4_1968" => decoder_cp1252,
|
||||
@@ -276,6 +276,7 @@ pub fn charset_decoder(charset: &[u8]) -> Option<DecoderFnc> {
|
||||
"x_user_defined" => decoder_x_user_defined,
|
||||
"x_x_big5" => decoder_big5,
|
||||
)
|
||||
.copied()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
+3
-2
@@ -256,8 +256,9 @@ macro_rules! header_names {
|
||||
}
|
||||
|
||||
pub(crate) fn header_map(name: &[u8]) -> Option<HeaderName<'static>> {
|
||||
hashify::tiny_map!(name,
|
||||
$($lc => HeaderName::$variant,)+
|
||||
hashify::fnc_map!(name,
|
||||
$($lc => Some(HeaderName::$variant),)+
|
||||
_ => None
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ impl<'x> MessageStream<'x> {
|
||||
}
|
||||
}
|
||||
|
||||
hashify::tiny_map! { buf.as_ref(),
|
||||
hashify::map! { buf.as_ref(), i32,
|
||||
"EDT" => -4,
|
||||
"EST" => -5,
|
||||
"CDT" => -5,
|
||||
@@ -462,6 +462,7 @@ impl<'x> MessageStream<'x> {
|
||||
"PDT" => -7,
|
||||
"PST" => -8,
|
||||
}
|
||||
.copied()
|
||||
.unwrap_or(0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ const MAX_PREFIX_LEN: usize = 40;
|
||||
const MAX_GENERIC_PREFIX_CHARS: usize = 4;
|
||||
|
||||
fn is_re_prefix(prefix: &str) -> bool {
|
||||
hashify::tiny_set! {prefix.as_bytes(),
|
||||
hashify::set! {prefix.as_bytes(),
|
||||
"re",
|
||||
"res",
|
||||
"resp",
|
||||
@@ -85,7 +85,7 @@ fn is_re_prefix(prefix: &str) -> bool {
|
||||
}
|
||||
|
||||
fn is_fwd_prefix(prefix: &str) -> bool {
|
||||
hashify::tiny_set! {prefix.as_bytes(),
|
||||
hashify::set! {prefix.as_bytes(),
|
||||
"fwd",
|
||||
"fw",
|
||||
"rv",
|
||||
|
||||
Reference in New Issue
Block a user