From #1620 , @aawsome suggested using the crate spire_enum.
This is a follow-up Issue for discussing this refactoring / new crate integration and to a later PR submission.
Inviting others to join this thread.
Original Comment:
I do think that the crate spire_enum should be able to derive this impl.
However, it introduces quite some build-dependencies. On the other hand, it could be also useful for rustic_core, so maybe we'll just use it...
Referring to:
src/config/progress_options.rs lines 312-352
impl Progress for RusticProgress {
fn is_hidden(&self) -> bool {
match self {
Self::Hidden(p) => p.is_hidden(),
Self::Interactive(p) => p.is_hidden(),
Self::NonInteractive(p) => p.is_hidden(),
}
}
fn set_length(&self, len: u64) {
match self {
Self::Hidden(p) => p.set_length(len),
Self::Interactive(p) => p.set_length(len),
Self::NonInteractive(p) => p.set_length(len),
}
}
fn set_title(&self, title: &'static str) {
match self {
Self::Hidden(p) => p.set_title(title),
Self::Interactive(p) => p.set_title(title),
Self::NonInteractive(p) => p.set_title(title),
}
}
fn inc(&self, inc: u64) {
match self {
Self::Hidden(p) => p.inc(inc),
Self::Interactive(p) => p.inc(inc),
Self::NonInteractive(p) => p.inc(inc),
}
}
fn finish(&self) {
match self {
Self::Hidden(p) => p.finish(),
Self::Interactive(p) => p.finish(),
Self::NonInteractive(p) => p.finish(),
}
}
}
From #1620 , @aawsome suggested using the crate
spire_enum.This is a follow-up Issue for discussing this refactoring / new crate integration and to a later PR submission.
Inviting others to join this thread.
Original Comment:
Referring to:
src/config/progress_options.rslines 312-352