Skip to content

Commit 4470f88

Browse files
committed
rust-tools: use RustEditon::ALL in impl FromStr
1 parent 3b1424e commit 4470f88

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

c2rust-rust-tools/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ impl FromStr for RustEdition {
4949
type Err = String;
5050

5151
fn from_str(s: &str) -> Result<Self, Self::Err> {
52-
let choices = [Self::Edition2021, Self::Edition2024];
52+
let choices = Self::ALL;
5353
choices
5454
.into_iter()
55+
.copied()
5556
.find(|choice| choice.as_str() == s)
5657
.ok_or_else(|| format!("{s} not one of {}", choices.iter().join(" ,")))
5758
}

0 commit comments

Comments
 (0)