We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e055466 commit 097c6ffCopy full SHA for 097c6ff
espflash/src/chip/mod.rs
@@ -141,11 +141,16 @@ impl FromStr for Chip {
141
type Err = Error;
142
143
fn from_str(s: &str) -> Result<Self, Self::Err> {
144
- match s.to_ascii_lowercase().as_str() {
+ let s: String = s
145
+ .chars()
146
+ .filter(|&c| c != '-')
147
+ .map(|c| c.to_ascii_lowercase())
148
+ .collect();
149
+ match s.as_str() {
150
"esp32" => Ok(Chip::Esp32),
- "esp32-c3" => Ok(Chip::Esp32c3),
- "esp32-s2" => Ok(Chip::Esp32s2),
- "esp32-s3" => Ok(Chip::Esp32s3),
151
+ "esp32c3" => Ok(Chip::Esp32c3),
152
+ "esp32s2" => Ok(Chip::Esp32s2),
153
+ "esp32s3" => Ok(Chip::Esp32s3),
154
"esp8266" => Ok(Chip::Esp8266),
155
_ => Err(Error::UnrecognizedChipName),
156
}
0 commit comments