Skip to content

Commit 2e300f3

Browse files
committed
Drop enum name from variant names
Signed-off-by: Janne Grunau <[email protected]>
1 parent 4cfee80 commit 2e300f3

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/cd321x.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,24 @@ enum VdmSopType {
3333
#[allow(dead_code)]
3434
#[derive(Debug, PartialEq)]
3535
enum TpsMode {
36-
TpsModeApp,
37-
TpsModeBoot,
38-
TpsModeBist,
39-
TpsModeDisc,
40-
TpsModePtch,
41-
TpsModeDbma,
36+
App,
37+
Boot,
38+
Bist,
39+
Disc,
40+
Ptch,
41+
Dbma,
4242
}
4343

4444
impl FromStr for TpsMode {
4545
type Err = ();
4646
fn from_str(input: &str) -> std::result::Result<TpsMode, ()> {
4747
match input {
48-
"APP " => Ok(TpsMode::TpsModeApp),
49-
"BOOT" => Ok(TpsMode::TpsModeBoot),
50-
"BIST" => Ok(TpsMode::TpsModeBist),
51-
"DISC" => Ok(TpsMode::TpsModeDisc),
52-
"PTCH" => Ok(TpsMode::TpsModePtch),
53-
"DBMa" => Ok(TpsMode::TpsModeDbma),
48+
"APP " => Ok(TpsMode::App),
49+
"BOOT" => Ok(TpsMode::Boot),
50+
"BIST" => Ok(TpsMode::Bist),
51+
"DISC" => Ok(TpsMode::Disc),
52+
"PTCH" => Ok(TpsMode::Ptch),
53+
"DBMa" => Ok(TpsMode::Dbma),
5454
_ => Err(()),
5555
}
5656
}
@@ -182,7 +182,7 @@ impl Device {
182182
fn dbma(&mut self, debug: bool) -> Result<()> {
183183
let data: [u8; 1] = if debug { [1] } else { [0] };
184184
self.exec_cmd(b"DBMa", &data)?;
185-
if self.get_mode()? != TpsMode::TpsModeDbma {
185+
if self.get_mode()? != TpsMode::Dbma {
186186
return Err(Error::TypecController);
187187
}
188188
Ok(())
@@ -192,7 +192,7 @@ impl Device {
192192
if vdos.is_empty() || vdos.len() > 7 {
193193
return Err(Error::InvalidArgument);
194194
}
195-
if self.get_mode()? != TpsMode::TpsModeDbma {
195+
if self.get_mode()? != TpsMode::Dbma {
196196
return Err(Error::TypecController);
197197
}
198198
let data = [
@@ -259,7 +259,7 @@ impl Device {
259259
info!("Putting target into serial mode...");
260260
self.vdms(VdmSopType::SopStar, &vdos)?;
261261
info!("Putting local end into serial mode... ");
262-
if self.get_mode()? != TpsMode::TpsModeDbma {
262+
if self.get_mode()? != TpsMode::Dbma {
263263
return Err(Error::TypecController);
264264
}
265265
self.dven(&vdos[1..2])

0 commit comments

Comments
 (0)