• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

duesee / imap-codec / 16085468327

05 Jul 2025 06:35AM UTC coverage: 90.913% (-0.8%) from 91.715%
16085468327

push

github

duesee
chore: fix Clippy lints

39 of 44 new or added lines in 17 files covered. (88.64%)

31 existing lines in 7 files now uncovered.

10315 of 11346 relevant lines covered (90.91%)

932.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.28
/imap-codec/src/fetch.rs
1
use std::num::NonZeroU32;
2

3
use abnf_core::streaming::sp;
4
use imap_types::{
5
    core::{AString, NString8, Vec1},
6
    fetch::{MessageDataItem, MessageDataItemName, Part, PartSpecifier, Section},
7
};
8
use nom::{
9
    branch::alt,
10
    bytes::streaming::{tag, tag_no_case},
11
    character::streaming::char,
12
    combinator::{map, opt, value},
13
    multi::separated_list1,
14
    sequence::{delimited, preceded, tuple},
15
};
16

17
#[cfg(feature = "ext_condstore_qresync")]
18
use crate::extensions::condstore_qresync::mod_sequence_value;
19
use crate::{
20
    body::body,
21
    core::{astring, nstring, number, nz_number},
22
    datetime::date_time,
23
    decode::IMAPResult,
24
    envelope::envelope,
25
    extensions::binary::{literal8, partial, section_binary},
26
    flag::flag_fetch,
27
};
28

29
/// ```abnf
30
/// fetch-att = "ENVELOPE" /
31
///             "FLAGS" /
32
///             "INTERNALDATE" /
33
///             "RFC822" [".HEADER" / ".SIZE" / ".TEXT"] /
34
///             "BODY" ["STRUCTURE"] /
35
///             "UID" /
36
///             "BODY"      section ["<" number "." nz-number ">"] /
37
///             "BODY.PEEK" section ["<" number "." nz-number ">"] /
38
///             "BINARY"      section-binary [partial] / ; RFC 3516
39
///             "BINARY.PEEK" section-binary [partial] / ; RFC 3516
40
///             "BINARY.SIZE" section-binary           / ; RFC 3516
41
///             "MODSEQ"                                 ; RFC 7162
42
/// ```
43
pub(crate) fn fetch_att(input: &[u8]) -> IMAPResult<&[u8], MessageDataItemName> {
112✔
44
    alt((
112✔
45
        value(MessageDataItemName::Envelope, tag_no_case(b"ENVELOPE")),
112✔
46
        value(MessageDataItemName::Flags, tag_no_case(b"FLAGS")),
112✔
47
        value(
112✔
48
            MessageDataItemName::InternalDate,
112✔
49
            tag_no_case(b"INTERNALDATE"),
112✔
50
        ),
51
        value(
112✔
52
            MessageDataItemName::BodyStructure,
112✔
53
            tag_no_case(b"BODYSTRUCTURE"),
112✔
54
        ),
55
        map(
112✔
56
            tuple((
112✔
57
                tag_no_case(b"BODY.PEEK"),
112✔
58
                section,
112✔
59
                opt(delimited(
112✔
60
                    tag(b"<"),
112✔
61
                    tuple((number, tag(b"."), nz_number)),
112✔
62
                    tag(b">"),
112✔
63
                )),
112✔
64
            )),
112✔
65
            |(_, section, byterange)| MessageDataItemName::BodyExt {
66
                section,
6✔
67
                partial: byterange.map(|(start, _, end)| (start, end)),
6✔
68
                peek: true,
69
            },
6✔
70
        ),
71
        map(
112✔
72
            tuple((
112✔
73
                tag_no_case(b"BODY"),
112✔
74
                section,
112✔
75
                opt(delimited(
112✔
76
                    tag(b"<"),
112✔
77
                    tuple((number, tag(b"."), nz_number)),
112✔
78
                    tag(b">"),
112✔
79
                )),
112✔
80
            )),
112✔
81
            |(_, section, byterange)| MessageDataItemName::BodyExt {
82
                section,
34✔
83
                partial: byterange.map(|(start, _, end)| (start, end)),
34✔
84
                peek: false,
85
            },
34✔
86
        ),
87
        map(
112✔
88
            tuple((tag_no_case("BINARY.PEEK"), section_binary, opt(partial))),
112✔
89
            |(_, section, partial)| MessageDataItemName::Binary {
90
                section,
×
91
                partial,
×
92
                peek: true,
UNCOV
93
            },
×
94
        ),
95
        map(
112✔
96
            tuple((tag_no_case("BINARY"), section_binary, opt(partial))),
112✔
97
            |(_, section, partial)| MessageDataItemName::Binary {
98
                section,
×
99
                partial,
×
100
                peek: false,
UNCOV
101
            },
×
102
        ),
103
        map(
112✔
104
            preceded(tag_no_case("BINARY.SIZE"), section_binary),
112✔
UNCOV
105
            |section| MessageDataItemName::BinarySize { section },
×
106
        ),
107
        value(MessageDataItemName::Body, tag_no_case(b"BODY")),
112✔
108
        value(MessageDataItemName::Uid, tag_no_case(b"UID")),
112✔
109
        value(
112✔
110
            MessageDataItemName::Rfc822Header,
112✔
111
            tag_no_case(b"RFC822.HEADER"),
112✔
112
        ),
113
        value(MessageDataItemName::Rfc822Size, tag_no_case(b"RFC822.SIZE")),
112✔
114
        value(MessageDataItemName::Rfc822Text, tag_no_case(b"RFC822.TEXT")),
112✔
115
        value(MessageDataItemName::Rfc822, tag_no_case(b"RFC822")),
112✔
116
        #[cfg(feature = "ext_condstore_qresync")]
117
        value(MessageDataItemName::ModSeq, tag_no_case(b"MODSEQ")),
112✔
118
    ))(input)
112✔
119
}
112✔
120

121
/// ```abnf
122
/// msg-att = "("
123
///           (msg-att-dynamic / msg-att-static) *(SP (msg-att-dynamic / msg-att-static))
124
///           ")"
125
/// ```
126
pub(crate) fn msg_att(input: &[u8]) -> IMAPResult<&[u8], Vec1<MessageDataItem>> {
196✔
127
    delimited(
196✔
128
        tag(b"("),
196✔
129
        map(
196✔
130
            separated_list1(sp, alt((msg_att_dynamic, msg_att_static))),
196✔
131
            Vec1::unvalidated,
196✔
132
        ),
196✔
133
        tag(b")"),
196✔
134
    )(input)
196✔
135
}
196✔
136

137
/// ```abnf
138
/// msg-att-dynamic = "FLAGS" SP "(" [flag-fetch *(SP flag-fetch)] ")"
139
/// ```
140
///
141
/// Note: MAY change for a message
142
pub(crate) fn msg_att_dynamic(input: &[u8]) -> IMAPResult<&[u8], MessageDataItem> {
324✔
143
    let flags = map(
324✔
144
        preceded(
324✔
145
            tag_no_case(b"FLAGS "),
324✔
146
            delimited(char('('), opt(separated_list1(sp, flag_fetch)), char(')')),
324✔
147
        ),
148
        |flags| MessageDataItem::Flags(flags.unwrap_or_default()),
160✔
149
    );
150
    #[cfg(feature = "ext_condstore_qresync")]
151
    let modseq = map(
324✔
152
        preceded(
324✔
153
            tag_no_case("MODSEQ "),
324✔
154
            delimited(char('('), mod_sequence_value, char(')')),
324✔
155
        ),
156
        MessageDataItem::ModSeq,
157
    );
158

159
    #[cfg(feature = "ext_condstore_qresync")]
160
    let mut parser = alt((flags, modseq));
324✔
161

162
    #[cfg(not(feature = "ext_condstore_qresync"))]
163
    let mut parser = flags;
164

165
    let (remaining, item) = parser(input)?;
324✔
166

167
    Ok((remaining, item))
160✔
168
}
324✔
169

170
/// ```abnf
171
/// msg-att-static = "ENVELOPE" SP envelope /
172
///                  "INTERNALDATE" SP date-time /
173
///                  "RFC822" [".HEADER" / ".TEXT"] SP nstring /
174
///                  "RFC822.SIZE" SP number /
175
///                  "BODY" ["STRUCTURE"] SP body /
176
///                  "BODY" section ["<" number ">"] SP nstring /
177
///                  "UID" SP uniqueid /
178
///                  "BINARY" section-binary SP (nstring / literal8) / ; RFC 3516
179
///                  "BINARY.SIZE" section-binary SP number            ; RFC 3516
180
/// ```
181
///
182
/// Note: MUST NOT change for a message
183
pub(crate) fn msg_att_static(input: &[u8]) -> IMAPResult<&[u8], MessageDataItem> {
164✔
184
    alt((
164✔
185
        map(
164✔
186
            preceded(tag_no_case(b"ENVELOPE "), envelope),
164✔
187
            MessageDataItem::Envelope,
188
        ),
189
        map(
164✔
190
            preceded(tag_no_case(b"INTERNALDATE "), date_time),
164✔
191
            MessageDataItem::InternalDate,
192
        ),
193
        map(
164✔
194
            preceded(tag_no_case(b"RFC822.HEADER "), nstring),
164✔
195
            MessageDataItem::Rfc822Header,
196
        ),
197
        map(
164✔
198
            preceded(tag_no_case(b"RFC822.TEXT "), nstring),
164✔
199
            MessageDataItem::Rfc822Text,
200
        ),
201
        map(
164✔
202
            preceded(tag_no_case(b"RFC822.SIZE "), number),
164✔
203
            MessageDataItem::Rfc822Size,
204
        ),
205
        map(
164✔
206
            preceded(tag_no_case(b"RFC822 "), nstring),
164✔
207
            MessageDataItem::Rfc822,
208
        ),
209
        map(
164✔
210
            preceded(tag_no_case(b"BODYSTRUCTURE "), body(8)),
164✔
211
            MessageDataItem::BodyStructure,
212
        ),
213
        map(
164✔
214
            preceded(tag_no_case(b"BODY "), body(8)),
164✔
215
            MessageDataItem::Body,
216
        ),
217
        map(
164✔
218
            tuple((
164✔
219
                tag_no_case(b"BODY"),
164✔
220
                section,
164✔
221
                opt(delimited(tag(b"<"), number, tag(b">"))),
164✔
222
                sp,
164✔
223
                nstring,
164✔
224
            )),
164✔
225
            |(_, section, origin, _, data)| MessageDataItem::BodyExt {
226
                section,
16✔
227
                origin,
16✔
228
                data,
16✔
229
            },
16✔
230
        ),
231
        map(
164✔
232
            preceded(tag_no_case(b"UID "), uniqueid),
164✔
233
            MessageDataItem::Uid,
234
        ),
235
        map(
164✔
236
            tuple((
164✔
237
                tag_no_case(b"BINARY"),
164✔
238
                section_binary,
164✔
239
                sp,
164✔
240
                alt((
164✔
241
                    map(nstring, NString8::NString),
164✔
242
                    map(literal8, NString8::Literal8),
164✔
243
                )),
164✔
244
            )),
164✔
UNCOV
245
            |(_, section, _, value)| MessageDataItem::Binary { section, value },
×
246
        ),
247
        map(
164✔
248
            tuple((tag_no_case(b"BINARY.SIZE"), section_binary, sp, number)),
164✔
UNCOV
249
            |(_, section, _, size)| MessageDataItem::BinarySize { section, size },
×
250
        ),
251
    ))(input)
164✔
252
}
164✔
253

254
#[inline]
255
/// `uniqueid = nz-number`
256
///
257
/// Note: Strictly ascending
258
pub(crate) fn uniqueid(input: &[u8]) -> IMAPResult<&[u8], NonZeroU32> {
48✔
259
    nz_number(input)
48✔
260
}
48✔
261

262
/// `section = "[" [section-spec] "]"`
263
pub(crate) fn section(input: &[u8]) -> IMAPResult<&[u8], Option<Section>> {
58✔
264
    delimited(tag(b"["), opt(section_spec), tag(b"]"))(input)
58✔
265
}
58✔
266

267
/// `section-spec = section-msgtext / (section-part ["." section-text])`
268
pub(crate) fn section_spec(input: &[u8]) -> IMAPResult<&[u8], Section> {
56✔
269
    alt((
56✔
270
        map(section_msgtext, |part_specifier| match part_specifier {
64✔
271
            PartSpecifier::PartNumber(_) => unreachable!(),
×
272
            PartSpecifier::Header => Section::Header(None),
32✔
273
            PartSpecifier::HeaderFields(fields) => Section::HeaderFields(None, fields),
16✔
274
            PartSpecifier::HeaderFieldsNot(fields) => Section::HeaderFieldsNot(None, fields),
×
275
            PartSpecifier::Text => Section::Text(None),
4✔
276
            PartSpecifier::Mime => unreachable!(),
×
277
        }),
52✔
278
        map(
56✔
279
            tuple((section_part, opt(tuple((tag(b"."), section_text))))),
56✔
UNCOV
280
            |(part_number, maybe_part_specifier)| {
×
281
                if let Some((_, part_specifier)) = maybe_part_specifier {
×
282
                    match part_specifier {
×
283
                        PartSpecifier::PartNumber(_) => unreachable!(),
×
284
                        PartSpecifier::Header => Section::Header(Some(Part(part_number))),
×
285
                        PartSpecifier::HeaderFields(fields) => {
×
286
                            Section::HeaderFields(Some(Part(part_number)), fields)
×
287
                        }
288
                        PartSpecifier::HeaderFieldsNot(fields) => {
×
289
                            Section::HeaderFieldsNot(Some(Part(part_number)), fields)
×
290
                        }
291
                        PartSpecifier::Text => Section::Text(Some(Part(part_number))),
×
292
                        PartSpecifier::Mime => Section::Mime(Part(part_number)),
×
293
                    }
294
                } else {
295
                    Section::Part(Part(part_number))
×
296
                }
UNCOV
297
            },
×
298
        ),
299
    ))(input)
56✔
300
}
56✔
301

302
/// `section-msgtext = "HEADER" / "HEADER.FIELDS" [".NOT"] SP header-list / "TEXT"`
303
///
304
/// Top-level or MESSAGE/RFC822 part
305
pub(crate) fn section_msgtext(input: &[u8]) -> IMAPResult<&[u8], PartSpecifier> {
56✔
306
    alt((
56✔
307
        map(
56✔
308
            tuple((tag_no_case(b"HEADER.FIELDS.NOT"), sp, header_list)),
56✔
UNCOV
309
            |(_, _, header_list)| PartSpecifier::HeaderFieldsNot(header_list),
×
310
        ),
311
        map(
56✔
312
            tuple((tag_no_case(b"HEADER.FIELDS"), sp, header_list)),
56✔
313
            |(_, _, header_list)| PartSpecifier::HeaderFields(header_list),
16✔
314
        ),
315
        value(PartSpecifier::Header, tag_no_case(b"HEADER")),
56✔
316
        value(PartSpecifier::Text, tag_no_case(b"TEXT")),
56✔
317
    ))(input)
56✔
318
}
56✔
319

320
#[inline]
321
/// `section-part = nz-number *("." nz-number)`
322
///
323
/// Body part nesting
324
pub(crate) fn section_part(input: &[u8]) -> IMAPResult<&[u8], Vec1<NonZeroU32>> {
4✔
325
    map(separated_list1(tag(b"."), nz_number), Vec1::unvalidated)(input)
4✔
326
}
4✔
327

328
/// `section-text = section-msgtext / "MIME"`
329
///
330
/// Text other than actual body part (headers, etc.)
331
pub(crate) fn section_text(input: &[u8]) -> IMAPResult<&[u8], PartSpecifier> {
×
332
    alt((
×
333
        section_msgtext,
×
334
        value(PartSpecifier::Mime, tag_no_case(b"MIME")),
×
335
    ))(input)
×
336
}
×
337

338
/// `header-list = "(" header-fld-name *(SP header-fld-name) ")"`
339
pub(crate) fn header_list(input: &[u8]) -> IMAPResult<&[u8], Vec1<AString>> {
16✔
340
    map(
16✔
341
        delimited(tag(b"("), separated_list1(sp, header_fld_name), tag(b")")),
16✔
342
        Vec1::unvalidated,
16✔
343
    )(input)
16✔
344
}
16✔
345

346
#[inline]
347
/// `header-fld-name = astring`
348
pub(crate) fn header_fld_name(input: &[u8]) -> IMAPResult<&[u8], AString> {
32✔
349
    astring(input)
32✔
350
}
32✔
351

352
#[cfg(test)]
353
mod tests {
354
    use imap_types::{
355
        body::{BasicFields, Body, BodyStructure, SpecificFields},
356
        core::{IString, NString},
357
        datetime::DateTime,
358
        envelope::Envelope,
359
    };
360

361
    use super::*;
362
    use crate::testing::known_answer_test_encode;
363

364
    #[test]
365
    fn test_encode_message_data_item_name() {
2✔
366
        let tests = [
2✔
367
            (MessageDataItemName::Body, b"BODY".as_ref()),
2✔
368
            (
2✔
369
                MessageDataItemName::BodyExt {
2✔
370
                    section: None,
2✔
371
                    partial: None,
2✔
372
                    peek: false,
2✔
373
                },
2✔
374
                b"BODY[]",
2✔
375
            ),
2✔
376
            (MessageDataItemName::BodyStructure, b"BODYSTRUCTURE"),
2✔
377
            (MessageDataItemName::Envelope, b"ENVELOPE"),
2✔
378
            (MessageDataItemName::Flags, b"FLAGS"),
2✔
379
            (MessageDataItemName::InternalDate, b"INTERNALDATE"),
2✔
380
            (MessageDataItemName::Rfc822, b"RFC822"),
2✔
381
            (MessageDataItemName::Rfc822Header, b"RFC822.HEADER"),
2✔
382
            (MessageDataItemName::Rfc822Size, b"RFC822.SIZE"),
2✔
383
            (MessageDataItemName::Rfc822Text, b"RFC822.TEXT"),
2✔
384
            (MessageDataItemName::Uid, b"UID"),
2✔
385
        ];
2✔
386

387
        for test in tests {
24✔
388
            known_answer_test_encode(test);
22✔
389
        }
22✔
390
    }
2✔
391

392
    #[test]
393
    fn test_encode_message_data_item() {
2✔
394
        let tests = [
2✔
395
            (
2✔
396
                MessageDataItem::Body(BodyStructure::Single {
2✔
397
                    body: Body {
2✔
398
                        basic: BasicFields {
2✔
399
                            parameter_list: vec![],
2✔
400
                            id: NString(None),
2✔
401
                            description: NString(None),
2✔
402
                            content_transfer_encoding: IString::try_from("base64").unwrap(),
2✔
403
                            size: 42,
2✔
404
                        },
2✔
405
                        specific: SpecificFields::Text {
2✔
406
                            subtype: IString::try_from("foo").unwrap(),
2✔
407
                            number_of_lines: 1337,
2✔
408
                        },
2✔
409
                    },
2✔
410
                    extension_data: None,
2✔
411
                }),
2✔
412
                b"BODY (\"TEXT\" \"foo\" NIL NIL NIL \"base64\" 42 1337)".as_ref(),
2✔
413
            ),
2✔
414
            (
2✔
415
                MessageDataItem::BodyExt {
2✔
416
                    section: None,
2✔
417
                    origin: None,
2✔
418
                    data: NString(None),
2✔
419
                },
2✔
420
                b"BODY[] NIL",
2✔
421
            ),
2✔
422
            (
2✔
423
                MessageDataItem::BodyExt {
2✔
424
                    section: None,
2✔
425
                    origin: Some(123),
2✔
426
                    data: NString(None),
2✔
427
                },
2✔
428
                b"BODY[]<123> NIL",
2✔
429
            ),
2✔
430
            (
2✔
431
                MessageDataItem::BodyStructure(BodyStructure::Single {
2✔
432
                    body: Body {
2✔
433
                        basic: BasicFields {
2✔
434
                            parameter_list: vec![],
2✔
435
                            id: NString(None),
2✔
436
                            description: NString(None),
2✔
437
                            content_transfer_encoding: IString::try_from("base64").unwrap(),
2✔
438
                            size: 213,
2✔
439
                        },
2✔
440
                        specific: SpecificFields::Text {
2✔
441
                            subtype: IString::try_from("").unwrap(),
2✔
442
                            number_of_lines: 224,
2✔
443
                        },
2✔
444
                    },
2✔
445
                    extension_data: None,
2✔
446
                }),
2✔
447
                b"BODYSTRUCTURE (\"TEXT\" \"\" NIL NIL NIL \"base64\" 213 224)",
2✔
448
            ),
2✔
449
            (
2✔
450
                MessageDataItem::Envelope(Envelope {
2✔
451
                    date: NString(None),
2✔
452
                    subject: NString(None),
2✔
453
                    from: vec![],
2✔
454
                    sender: vec![],
2✔
455
                    reply_to: vec![],
2✔
456
                    to: vec![],
2✔
457
                    cc: vec![],
2✔
458
                    bcc: vec![],
2✔
459
                    in_reply_to: NString(None),
2✔
460
                    message_id: NString(None),
2✔
461
                }),
2✔
462
                b"ENVELOPE (NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)",
2✔
463
            ),
2✔
464
            (MessageDataItem::Flags(vec![]), b"FLAGS ()"),
2✔
465
            (
2✔
466
                MessageDataItem::InternalDate(
2✔
467
                    DateTime::try_from(
2✔
468
                        chrono::DateTime::parse_from_rfc2822("Tue, 1 Jul 2003 10:52:37 +0200")
2✔
469
                            .unwrap(),
2✔
470
                    )
2✔
471
                    .unwrap(),
2✔
472
                ),
2✔
473
                b"INTERNALDATE \"01-Jul-2003 10:52:37 +0200\"",
2✔
474
            ),
2✔
475
            (MessageDataItem::Rfc822(NString(None)), b"RFC822 NIL"),
2✔
476
            (
2✔
477
                MessageDataItem::Rfc822Header(NString(None)),
2✔
478
                b"RFC822.HEADER NIL",
2✔
479
            ),
2✔
480
            (MessageDataItem::Rfc822Size(3456), b"RFC822.SIZE 3456"),
2✔
481
            (
2✔
482
                MessageDataItem::Rfc822Text(NString(None)),
2✔
483
                b"RFC822.TEXT NIL",
2✔
484
            ),
2✔
485
            (
2✔
486
                MessageDataItem::Uid(NonZeroU32::try_from(u32::MAX).unwrap()),
2✔
487
                b"UID 4294967295",
2✔
488
            ),
2✔
489
        ];
2✔
490

491
        for test in tests {
26✔
492
            known_answer_test_encode(test);
24✔
493
        }
24✔
494
    }
2✔
495

496
    #[test]
497
    fn test_encode_section() {
2✔
498
        let tests = [
2✔
499
            (
2✔
500
                Section::Part(Part(Vec1::from(NonZeroU32::try_from(1).unwrap()))),
2✔
501
                b"1".as_ref(),
2✔
502
            ),
2✔
503
            (Section::Header(None), b"HEADER"),
2✔
504
            (
2✔
505
                Section::Header(Some(Part(Vec1::from(NonZeroU32::try_from(1).unwrap())))),
2✔
506
                b"1.HEADER",
2✔
507
            ),
2✔
508
            (
2✔
509
                Section::HeaderFields(None, Vec1::from(AString::try_from("").unwrap())),
2✔
510
                b"HEADER.FIELDS (\"\")",
2✔
511
            ),
2✔
512
            (
2✔
513
                Section::HeaderFields(
2✔
514
                    Some(Part(Vec1::from(NonZeroU32::try_from(1).unwrap()))),
2✔
515
                    Vec1::from(AString::try_from("").unwrap()),
2✔
516
                ),
2✔
517
                b"1.HEADER.FIELDS (\"\")",
2✔
518
            ),
2✔
519
            (
2✔
520
                Section::HeaderFieldsNot(None, Vec1::from(AString::try_from("").unwrap())),
2✔
521
                b"HEADER.FIELDS.NOT (\"\")",
2✔
522
            ),
2✔
523
            (
2✔
524
                Section::HeaderFieldsNot(
2✔
525
                    Some(Part(Vec1::from(NonZeroU32::try_from(1).unwrap()))),
2✔
526
                    Vec1::from(AString::try_from("").unwrap()),
2✔
527
                ),
2✔
528
                b"1.HEADER.FIELDS.NOT (\"\")",
2✔
529
            ),
2✔
530
            (Section::Text(None), b"TEXT"),
2✔
531
            (
2✔
532
                Section::Text(Some(Part(Vec1::from(NonZeroU32::try_from(1).unwrap())))),
2✔
533
                b"1.TEXT",
2✔
534
            ),
2✔
535
            (
2✔
536
                Section::Mime(Part(Vec1::from(NonZeroU32::try_from(1).unwrap()))),
2✔
537
                b"1.MIME",
2✔
538
            ),
2✔
539
        ];
2✔
540

541
        for test in tests {
22✔
542
            known_answer_test_encode(test)
20✔
543
        }
544
    }
2✔
545
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc