janitor: use the new default attribute for enums

This commit is contained in:
Simon Hausmann 2022-12-05 09:39:28 +01:00 committed by Simon Hausmann
parent 7e77a2a4cc
commit 7122d22c88
10 changed files with 28 additions and 97 deletions

View file

@ -326,20 +326,15 @@ impl Component {
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
pub enum PropertyVisibility {
#[default]
Private,
Input,
Output,
InOut,
}
impl Default for PropertyVisibility {
fn default() -> Self {
Self::Private
}
}
impl Display for PropertyVisibility {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {