Merge branch 'master' into advanced-text

This commit is contained in:
Héctor Ramón Jiménez 2023-03-17 20:17:23 +01:00
commit d1dc62ebcd
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
7 changed files with 21 additions and 38 deletions

View file

@ -6,7 +6,7 @@ The __[`main`]__ file contains all the code of the example.
You can run it with `cargo run`:
```
cargo run --package pick_list
cargo run --package checkbox
```
[`main`]: src/main.rs

View file

@ -61,8 +61,9 @@ impl Sandbox for Example {
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Language {
#[default]
Rust,
Elm,
Ruby,
@ -84,12 +85,6 @@ impl Language {
];
}
impl Default for Language {
fn default() -> Language {
Language::Rust
}
}
impl std::fmt::Display for Language {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(

View file

@ -440,19 +440,16 @@ fn view_controls(tasks: &[Task], current_filter: Filter) -> Element<Message> {
.into()
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[derive(
Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize,
)]
pub enum Filter {
#[default]
All,
Active,
Completed,
}
impl Default for Filter {
fn default() -> Self {
Filter::All
}
}
impl Filter {
fn matches(&self, task: &Task) -> bool {
match self {