Skip to content

Commit

Permalink
Remove the usage of the Debug trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Nov 29, 2023
1 parent 8f103d1 commit cf72aea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion four-bar-ui/src/app/proj/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn stat_combo(res: &mut Response, ui: &mut Ui, stat: &mut Stat, has_branch: bool
ui.label("State");
for label in states {
*res |= ui
.selectable_value(stat, label, format!("{label:?}"))
.selectable_value(stat, label, label.name_uppercase())
.on_hover_text(format!("{label}"));
}
});
Expand Down
12 changes: 11 additions & 1 deletion four-bar/src/fb/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl TryFrom<u8> for Stat {

impl Stat {
/// Get the lowercase name.
pub fn name_lowercase(&self) -> &'static str {
pub const fn name_lowercase(&self) -> &'static str {
match self {
Self::C1B1 => "c1b1",
Self::C1B2 => "c1b2",
Expand All @@ -68,6 +68,16 @@ impl Stat {
}
}

/// Get the uppercase name.
pub const fn name_uppercase(&self) -> &'static str {
match self {
Self::C1B1 => "C1B1",
Self::C1B2 => "C1B2",
Self::C2B1 => "C2B1",
Self::C2B2 => "C2B2",
}
}

/// List for two circuits.
pub fn list2() -> Vec<Self> {
vec![Self::C1B1, Self::C2B1]
Expand Down

0 comments on commit cf72aea

Please sign in to comment.