Skip to content

Commit 47d8e75

Browse files
dbaronnigelmegitt
authored andcommitted
Convert .into_iter() into .iter() as suggested by the compiler.
This fixes the following warning issued by rustc 1.41.0: warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added. --> src/lib.rs:921:55 | 921 | ["github:", "github topic:", "github issue:"].into_iter(), | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = note: `#[warn(array_into_iter)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #66145 <rust-lang/rust#66145>
1 parent ab72478 commit 47d8e75

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ fn extract_github_url(
918918
}
919919
if let Some(ref maybe_url) = strip_one_ci_prefix(
920920
&message,
921-
["github:", "github topic:", "github issue:"].into_iter(),
921+
["github:", "github topic:", "github issue:"].iter(),
922922
) {
923923
if maybe_url.to_lowercase() == "none" {
924924
(Some(None), None)
@@ -1140,7 +1140,7 @@ impl GithubCommentTask {
11401140
if remove_from_agenda {
11411141
// We had resolutions, so remove the "Agenda+" and
11421142
// "Agenda+ F2F" tags, if present.
1143-
for label in ["Agenda+", "Agenda+ F2F"].into_iter() {
1143+
for label in ["Agenda+", "Agenda+ F2F"].iter() {
11441144
// Test for presence of the label first, so that we can
11451145
// report errors when removing it.
11461146
if labels_vec.iter().any(|ref l| l.name == *label) {
@@ -1241,19 +1241,19 @@ mod tests {
12411241
#[test]
12421242
fn test_strip_one_ci_prefix() {
12431243
assert_eq!(
1244-
strip_one_ci_prefix("GitHub:url goes here", ["issue:", "github:"].into_iter()),
1244+
strip_one_ci_prefix("GitHub:url goes here", ["issue:", "github:"].iter()),
12451245
Some(String::from("url goes here"))
12461246
);
12471247
assert_eq!(
1248-
strip_one_ci_prefix("GITHUB: url goes here", ["issue:", "github:"].into_iter()),
1248+
strip_one_ci_prefix("GITHUB: url goes here", ["issue:", "github:"].iter()),
12491249
Some(String::from("url goes here"))
12501250
);
12511251
assert_eq!(
1252-
strip_one_ci_prefix("issue: url goes here", ["issue:", "github:"].into_iter()),
1252+
strip_one_ci_prefix("issue: url goes here", ["issue:", "github:"].iter()),
12531253
Some(String::from("url goes here"))
12541254
);
12551255
assert_eq!(
1256-
strip_one_ci_prefix("topic: url goes here", ["issue:", "github:"].into_iter()),
1256+
strip_one_ci_prefix("topic: url goes here", ["issue:", "github:"].iter()),
12571257
None
12581258
);
12591259
}

0 commit comments

Comments
 (0)