Skip to content

Commit 279aae8

Browse files
committed
Fix warnings from 1.89 lints
1 parent 238cb95 commit 279aae8

File tree

15 files changed

+101
-101
lines changed

15 files changed

+101
-101
lines changed

imap-proto/src/builders/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn changed_since(cmd: &mut Vec<u8>, seq: u64) {
304304
/// QUOTED-CHAR = <any TEXT-CHAR except quoted-specials> / "\" quoted-specials
305305
/// quoted-specials = DQUOTE / "\"
306306
/// TEXT-CHAR = <any CHAR except CR and LF>
307-
fn quoted_string(s: &str) -> Result<Cow<str>, &'static str> {
307+
fn quoted_string(s: &str) -> Result<Cow<'_, str>, &'static str> {
308308
let bytes = s.as_bytes();
309309
let (mut start, mut new) = (0, Vec::<u8>::new());
310310
for (i, b) in bytes.iter().enumerate() {

imap-proto/src/parser/gmail.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@ use crate::{AttributeValue, MailboxDatum};
1111
use super::core::{number_64, parenthesized_list, quoted_utf8};
1212
use super::rfc3501::flag;
1313

14-
pub(crate) fn gmail_label_list(i: &[u8]) -> IResult<&[u8], Vec<Cow<str>>> {
14+
pub(crate) fn gmail_label_list(i: &[u8]) -> IResult<&[u8], Vec<Cow<'_, str>>> {
1515
preceded(
1616
tag_no_case("X-GM-LABELS "),
1717
parenthesized_list(map(alt((flag, quoted_utf8)), Cow::Borrowed)),
1818
)(i)
1919
}
2020

21-
pub(crate) fn msg_att_gmail_labels(i: &[u8]) -> IResult<&[u8], AttributeValue> {
21+
pub(crate) fn msg_att_gmail_labels(i: &[u8]) -> IResult<&[u8], AttributeValue<'_>> {
2222
map(gmail_label_list, AttributeValue::GmailLabels)(i)
2323
}
2424

25-
pub(crate) fn mailbox_data_gmail_labels(i: &[u8]) -> IResult<&[u8], MailboxDatum> {
25+
pub(crate) fn mailbox_data_gmail_labels(i: &[u8]) -> IResult<&[u8], MailboxDatum<'_>> {
2626
map(gmail_label_list, MailboxDatum::GmailLabels)(i)
2727
}
2828

2929
pub(crate) fn gmail_msgid(i: &[u8]) -> IResult<&[u8], u64> {
3030
preceded(tag_no_case("X-GM-MSGID "), number_64)(i)
3131
}
3232

33-
pub(crate) fn msg_att_gmail_msgid(i: &[u8]) -> IResult<&[u8], AttributeValue> {
33+
pub(crate) fn msg_att_gmail_msgid(i: &[u8]) -> IResult<&[u8], AttributeValue<'_>> {
3434
map(gmail_msgid, AttributeValue::GmailMsgId)(i)
3535
}
3636

37-
pub(crate) fn mailbox_data_gmail_msgid(i: &[u8]) -> IResult<&[u8], MailboxDatum> {
37+
pub(crate) fn mailbox_data_gmail_msgid(i: &[u8]) -> IResult<&[u8], MailboxDatum<'_>> {
3838
map(gmail_msgid, MailboxDatum::GmailMsgId)(i)
3939
}
4040

4141
pub(crate) fn gmail_thrid(i: &[u8]) -> IResult<&[u8], u64> {
4242
preceded(tag_no_case("X-GM-THRID "), number_64)(i)
4343
}
4444

45-
pub(crate) fn msg_att_gmail_thrid(i: &[u8]) -> IResult<&[u8], AttributeValue> {
45+
pub(crate) fn msg_att_gmail_thrid(i: &[u8]) -> IResult<&[u8], AttributeValue<'_>> {
4646
map(gmail_thrid, AttributeValue::GmailThrId)(i)
4747
}
4848

49-
pub(crate) fn mailbox_data_gmail_thrid(i: &[u8]) -> IResult<&[u8], MailboxDatum> {
49+
pub(crate) fn mailbox_data_gmail_thrid(i: &[u8]) -> IResult<&[u8], MailboxDatum<'_>> {
5050
map(gmail_thrid, MailboxDatum::GmailThrId)(i)
5151
}
5252

imap-proto/src/parser/rfc2087.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use super::core::number_64;
2626
/// ```ignore
2727
/// quota_response ::= "QUOTA" SP astring SP quota_list
2828
/// ```
29-
pub(crate) fn quota(i: &[u8]) -> IResult<&[u8], Response> {
29+
pub(crate) fn quota(i: &[u8]) -> IResult<&[u8], Response<'_>> {
3030
let (rest, (_, _, root_name, _, resources)) = tuple((
3131
tag_no_case("QUOTA"),
3232
space1,
@@ -47,21 +47,21 @@ pub(crate) fn quota(i: &[u8]) -> IResult<&[u8], Response> {
4747
/// ```ignore
4848
/// quota_list ::= "(" #quota_resource ")"
4949
/// ```
50-
pub(crate) fn quota_list(i: &[u8]) -> IResult<&[u8], Vec<QuotaResource>> {
50+
pub(crate) fn quota_list(i: &[u8]) -> IResult<&[u8], Vec<QuotaResource<'_>>> {
5151
delimited(tag("("), separated_list0(space1, quota_resource), tag(")"))(i)
5252
}
5353

5454
/// ```ignore
5555
/// quota_resource ::= atom SP number SP number
5656
/// ```
57-
pub(crate) fn quota_resource(i: &[u8]) -> IResult<&[u8], QuotaResource> {
57+
pub(crate) fn quota_resource(i: &[u8]) -> IResult<&[u8], QuotaResource<'_>> {
5858
let (rest, (name, _, usage, _, limit)) =
5959
tuple((quota_resource_name, space1, number_64, space1, number_64))(i)?;
6060

6161
Ok((rest, QuotaResource { name, usage, limit }))
6262
}
6363

64-
pub(crate) fn quota_resource_name(i: &[u8]) -> IResult<&[u8], QuotaResourceName> {
64+
pub(crate) fn quota_resource_name(i: &[u8]) -> IResult<&[u8], QuotaResourceName<'_>> {
6565
alt((
6666
map(tag_no_case("STORAGE"), |_| QuotaResourceName::Storage),
6767
map(tag_no_case("MESSAGE"), |_| QuotaResourceName::Message),
@@ -73,7 +73,7 @@ pub(crate) fn quota_resource_name(i: &[u8]) -> IResult<&[u8], QuotaResourceName>
7373
/// ```ignore
7474
/// quotaroot_response ::= "QUOTAROOT" SP astring *(SP astring)
7575
/// ```
76-
pub(crate) fn quota_root(i: &[u8]) -> IResult<&[u8], Response> {
76+
pub(crate) fn quota_root(i: &[u8]) -> IResult<&[u8], Response<'_>> {
7777
let (rest, (_, _, mailbox_name, quota_root_names)) = tuple((
7878
tag_no_case("QUOTAROOT"),
7979
space1,
@@ -223,7 +223,7 @@ mod tests {
223223
);
224224
}
225225

226-
fn terminated_quota_root(i: &[u8]) -> IResult<&[u8], Response> {
226+
fn terminated_quota_root(i: &[u8]) -> IResult<&[u8], Response<'_>> {
227227
nom::sequence::terminated(quota_root, nom::bytes::streaming::tag("\r\n"))(i)
228228
}
229229

imap-proto/src/parser/rfc2971.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn id_param_list(i: &[u8]) -> IResult<&[u8], Option<HashMap<&str, &str>>> {
6464

6565
// id_response ::= "ID" SPACE id_params_list
6666
// [RFC2971 - Formal Syntax](https://tools.ietf.org/html/rfc2971#section-4)
67-
pub(crate) fn resp_id(i: &[u8]) -> IResult<&[u8], Response> {
67+
pub(crate) fn resp_id(i: &[u8]) -> IResult<&[u8], Response<'_>> {
6868
let (rest, map) = map(
6969
tuple((tag_no_case("ID"), space1, id_param_list)),
7070
|(_id, _sp, p)| p,

imap-proto/src/parser/rfc3501/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn section(i: &[u8]) -> IResult<&[u8], Option<SectionPath>> {
5454
delimited(char('['), opt(section_spec), char(']'))(i)
5555
}
5656

57-
pub fn msg_att_body_section(i: &[u8]) -> IResult<&[u8], AttributeValue> {
57+
pub fn msg_att_body_section(i: &[u8]) -> IResult<&[u8], AttributeValue<'_>> {
5858
map(
5959
tuple((
6060
tag_no_case("BODY"),

imap-proto/src/parser/rfc3501/body_structure.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616

1717
// body-fields = body-fld-param SP body-fld-id SP body-fld-desc SP
1818
// body-fld-enc SP body-fld-octets
19-
fn body_fields(i: &[u8]) -> IResult<&[u8], BodyFields> {
19+
fn body_fields(i: &[u8]) -> IResult<&[u8], BodyFields<'_>> {
2020
let (i, (param, _, id, _, description, _, transfer_encoding, _, octets)) = tuple((
2121
body_param,
2222
tag(" "),
@@ -48,7 +48,7 @@ fn body_fields(i: &[u8]) -> IResult<&[u8], BodyFields> {
4848
// [SP body-fld-loc *(SP body-extension)]]]
4949
// ; MUST NOT be returned on non-extensible
5050
// ; "BODY" fetch
51-
fn body_ext_1part(i: &[u8]) -> IResult<&[u8], BodyExt1Part> {
51+
fn body_ext_1part(i: &[u8]) -> IResult<&[u8], BodyExt1Part<'_>> {
5252
let (i, (md5, disposition, language, location, extension)) = tuple((
5353
// Per RFC 1864, MD5 values are base64-encoded
5454
opt_opt(preceded(tag(" "), nstring_utf8)),
@@ -74,7 +74,7 @@ fn body_ext_1part(i: &[u8]) -> IResult<&[u8], BodyExt1Part> {
7474
// [SP body-fld-loc *(SP body-extension)]]]
7575
// ; MUST NOT be returned on non-extensible
7676
// ; "BODY" fetch
77-
fn body_ext_mpart(i: &[u8]) -> IResult<&[u8], BodyExtMPart> {
77+
fn body_ext_mpart(i: &[u8]) -> IResult<&[u8], BodyExtMPart<'_>> {
7878
let (i, (param, disposition, language, location, extension)) = tuple((
7979
opt_opt(preceded(tag(" "), body_param)),
8080
opt_opt(preceded(tag(" "), body_disposition)),
@@ -95,7 +95,7 @@ fn body_ext_mpart(i: &[u8]) -> IResult<&[u8], BodyExtMPart> {
9595
))
9696
}
9797

98-
fn body_encoding(i: &[u8]) -> IResult<&[u8], ContentEncoding> {
98+
fn body_encoding(i: &[u8]) -> IResult<&[u8], ContentEncoding<'_>> {
9999
alt((
100100
delimited(
101101
char('"'),
@@ -127,7 +127,7 @@ fn body_lang(i: &[u8]) -> IResult<&[u8], Option<Vec<Cow<'_, str>>>> {
127127
))(i)
128128
}
129129

130-
fn body_param(i: &[u8]) -> IResult<&[u8], BodyParams> {
130+
fn body_param(i: &[u8]) -> IResult<&[u8], BodyParams<'_>> {
131131
alt((
132132
map(nil, |_| None),
133133
map(
@@ -140,7 +140,7 @@ fn body_param(i: &[u8]) -> IResult<&[u8], BodyParams> {
140140
))(i)
141141
}
142142

143-
fn body_extension(i: &[u8]) -> IResult<&[u8], BodyExtension> {
143+
fn body_extension(i: &[u8]) -> IResult<&[u8], BodyExtension<'_>> {
144144
alt((
145145
map(number, BodyExtension::Num),
146146
// Cannot find documentation on character encoding for body extension values.
@@ -153,7 +153,7 @@ fn body_extension(i: &[u8]) -> IResult<&[u8], BodyExtension> {
153153
))(i)
154154
}
155155

156-
fn body_disposition(i: &[u8]) -> IResult<&[u8], Option<ContentDisposition>> {
156+
fn body_disposition(i: &[u8]) -> IResult<&[u8], Option<ContentDisposition<'_>>> {
157157
alt((
158158
map(nil, |_| None),
159159
paren_delimited(map(
@@ -168,7 +168,7 @@ fn body_disposition(i: &[u8]) -> IResult<&[u8], Option<ContentDisposition>> {
168168
))(i)
169169
}
170170

171-
fn body_type_basic(i: &[u8]) -> IResult<&[u8], BodyStructure> {
171+
fn body_type_basic(i: &[u8]) -> IResult<&[u8], BodyStructure<'_>> {
172172
map(
173173
tuple((
174174
string_utf8,
@@ -201,7 +201,7 @@ fn body_type_basic(i: &[u8]) -> IResult<&[u8], BodyStructure> {
201201
)(i)
202202
}
203203

204-
fn body_type_text(i: &[u8]) -> IResult<&[u8], BodyStructure> {
204+
fn body_type_text(i: &[u8]) -> IResult<&[u8], BodyStructure<'_>> {
205205
map(
206206
tuple((
207207
tag_no_case("\"TEXT\""),
@@ -237,7 +237,7 @@ fn body_type_text(i: &[u8]) -> IResult<&[u8], BodyStructure> {
237237
)(i)
238238
}
239239

240-
fn body_type_message(i: &[u8]) -> IResult<&[u8], BodyStructure> {
240+
fn body_type_message(i: &[u8]) -> IResult<&[u8], BodyStructure<'_>> {
241241
map(
242242
tuple((
243243
tag_no_case("\"MESSAGE\" \"RFC822\""),
@@ -277,7 +277,7 @@ fn body_type_message(i: &[u8]) -> IResult<&[u8], BodyStructure> {
277277
)(i)
278278
}
279279

280-
fn body_type_multipart(i: &[u8]) -> IResult<&[u8], BodyStructure> {
280+
fn body_type_multipart(i: &[u8]) -> IResult<&[u8], BodyStructure<'_>> {
281281
map(
282282
tuple((many1(body), tag(" "), string_utf8, body_ext_mpart)),
283283
|(bodies, _, subtype, ext)| BodyStructure::Multipart {
@@ -297,7 +297,7 @@ fn body_type_multipart(i: &[u8]) -> IResult<&[u8], BodyStructure> {
297297
)(i)
298298
}
299299

300-
pub(crate) fn body(i: &[u8]) -> IResult<&[u8], BodyStructure> {
300+
pub(crate) fn body(i: &[u8]) -> IResult<&[u8], BodyStructure<'_>> {
301301
paren_delimited(alt((
302302
body_type_text,
303303
body_type_message,
@@ -306,7 +306,7 @@ pub(crate) fn body(i: &[u8]) -> IResult<&[u8], BodyStructure> {
306306
)))(i)
307307
}
308308

309-
pub(crate) fn msg_att_body_structure(i: &[u8]) -> IResult<&[u8], AttributeValue> {
309+
pub(crate) fn msg_att_body_structure(i: &[u8]) -> IResult<&[u8], AttributeValue<'_>> {
310310
map(tuple((tag_no_case("BODYSTRUCTURE "), body)), |(_, body)| {
311311
AttributeValue::BodyStructure(body)
312312
})(i)

0 commit comments

Comments
 (0)