diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-12-23 12:51:54 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-12-23 12:51:54 +0100 |
commit | 31193c2bef934d26265673c91cbea0b64a53cd15 (patch) | |
tree | 105163b13ed6fcb43e655f233679cc5947cf0b7b /internals/src/bind/quoted_string.rs | |
parent | 71ea078d4eb5d857680a69b01f7427ea43e2f5a2 (diff) |
Run cargo-fmt on codebasecargo-fmt
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'internals/src/bind/quoted_string.rs')
-rw-r--r-- | internals/src/bind/quoted_string.rs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/internals/src/bind/quoted_string.rs b/internals/src/bind/quoted_string.rs index 2a5c3ab..12cb456 100644 --- a/internals/src/bind/quoted_string.rs +++ b/internals/src/bind/quoted_string.rs @@ -1,11 +1,7 @@ -use quoted_string::spec::{ - GeneralQSSpec, - PartialCodePoint, - WithoutQuotingValidator -}; +use quoted_string::spec::{GeneralQSSpec, PartialCodePoint, WithoutQuotingValidator}; use media_type_impl_utils::quoted_string; -use ::MailType; +use MailType; /// A Quoted String specification in context of Mail ([rfc5322](https://tools.ietf.org/html/rfc5322#section-2.2.3)) /// @@ -21,7 +17,6 @@ impl GeneralQSSpec for MailQsSpec { type Parsing = quoted_string::MimeParsing; } - /// A Quoted String specification in context of Mail ([rfc5322](https://tools.ietf.org/html/rfc5322#section-2.2.3)) /// /// This implementation of MailQsSpec _does not_ include support for the obsolete parts of the grammar @@ -37,10 +32,9 @@ impl GeneralQSSpec for InternationalizedMailQsSpec { pub use self::quoted_string::MimeTokenValidator as UnquotedTokenValidator; - #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub struct UnquotedATextValidator { - mail_type: MailType + mail_type: MailType, } impl UnquotedATextValidator { @@ -51,20 +45,22 @@ impl UnquotedATextValidator { impl WithoutQuotingValidator for UnquotedATextValidator { fn next(&mut self, pcp: PartialCodePoint) -> bool { - is_atext(pcp, self.mail_type) + is_atext(pcp, self.mail_type) } } - #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub struct UnquotedDotAtomTextValidator { mail_type: MailType, - allow_dot: bool + allow_dot: bool, } impl UnquotedDotAtomTextValidator { pub fn new(mail_type: MailType) -> Self { - UnquotedDotAtomTextValidator { mail_type, allow_dot: false } + UnquotedDotAtomTextValidator { + mail_type, + allow_dot: false, + } } } @@ -88,7 +84,6 @@ impl WithoutQuotingValidator for UnquotedDotAtomTextValidator { } } - //TODO replace with lookup table (which could be placed in `::grammar`)! fn is_atext(pcp: PartialCodePoint, mail_type: MailType) -> bool { use grammar::is_special; |