Move declaration of SortOrder in cached example

This commit is contained in:
Héctor Ramón Jiménez 2022-11-03 02:32:38 +01:00
parent 1fb84ae5d3
commit 0e295be891
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -12,25 +12,6 @@ pub fn main() -> iced::Result {
App::run(Settings::default())
}
#[derive(Hash)]
enum SortOrder {
Ascending,
Descending,
}
impl std::fmt::Display for SortOrder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Ascending => "Ascending",
Self::Descending => "Descending",
}
)
}
}
struct App {
options: HashSet<String>,
input: String,
@ -139,3 +120,22 @@ impl Sandbox for App {
.into()
}
}
#[derive(Debug, Hash)]
enum SortOrder {
Ascending,
Descending,
}
impl std::fmt::Display for SortOrder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Ascending => "Ascending",
Self::Descending => "Descending",
}
)
}
}