diff options
| author | 2022-11-03 02:32:38 +0100 | |
|---|---|---|
| committer | 2022-11-03 02:32:38 +0100 | |
| commit | 0e295be8917a543e3641f8c4657db87fed0ce91b (patch) | |
| tree | 5ab8e1dd9ec0c9118d2ffa4eba2bee7e2c38c67a /examples/cached/src | |
| parent | 1fb84ae5d3732ed51b35fb5419a5ad014e22ca5b (diff) | |
| download | iced-0e295be8917a543e3641f8c4657db87fed0ce91b.tar.gz iced-0e295be8917a543e3641f8c4657db87fed0ce91b.tar.bz2 iced-0e295be8917a543e3641f8c4657db87fed0ce91b.zip | |
Move declaration of `SortOrder` in `cached` example
Diffstat (limited to 'examples/cached/src')
| -rw-r--r-- | examples/cached/src/main.rs | 38 | 
1 files changed, 19 insertions, 19 deletions
| diff --git a/examples/cached/src/main.rs b/examples/cached/src/main.rs index d7787979..b900ff36 100644 --- a/examples/cached/src/main.rs +++ b/examples/cached/src/main.rs @@ -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", +            } +        ) +    } +} | 
