Skip to content

Commit

Permalink
Convert .into_iter() into .iter() as suggested by the compiler.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dbaron authored and nigelmegitt committed Jul 21, 2022
1 parent ab72478 commit 47d8e75
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ fn extract_github_url(
}
if let Some(ref maybe_url) = strip_one_ci_prefix(
&message,
["github:", "github topic:", "github issue:"].into_iter(),
["github:", "github topic:", "github issue:"].iter(),
) {
if maybe_url.to_lowercase() == "none" {
(Some(None), None)
Expand Down Expand Up @@ -1140,7 +1140,7 @@ impl GithubCommentTask {
if remove_from_agenda {
// We had resolutions, so remove the "Agenda+" and
// "Agenda+ F2F" tags, if present.
for label in ["Agenda+", "Agenda+ F2F"].into_iter() {
for label in ["Agenda+", "Agenda+ F2F"].iter() {
// Test for presence of the label first, so that we can
// report errors when removing it.
if labels_vec.iter().any(|ref l| l.name == *label) {
Expand Down Expand Up @@ -1241,19 +1241,19 @@ mod tests {
#[test]
fn test_strip_one_ci_prefix() {
assert_eq!(
strip_one_ci_prefix("GitHub:url goes here", ["issue:", "github:"].into_iter()),
strip_one_ci_prefix("GitHub:url goes here", ["issue:", "github:"].iter()),
Some(String::from("url goes here"))
);
assert_eq!(
strip_one_ci_prefix("GITHUB: url goes here", ["issue:", "github:"].into_iter()),
strip_one_ci_prefix("GITHUB: url goes here", ["issue:", "github:"].iter()),
Some(String::from("url goes here"))
);
assert_eq!(
strip_one_ci_prefix("issue: url goes here", ["issue:", "github:"].into_iter()),
strip_one_ci_prefix("issue: url goes here", ["issue:", "github:"].iter()),
Some(String::from("url goes here"))
);
assert_eq!(
strip_one_ci_prefix("topic: url goes here", ["issue:", "github:"].into_iter()),
strip_one_ci_prefix("topic: url goes here", ["issue:", "github:"].iter()),
None
);
}
Expand Down

0 comments on commit 47d8e75

Please sign in to comment.