Fix lints for Rust 1.86
This commit is contained in:
parent
1b22d7d5fc
commit
53ce0e3a88
6 changed files with 21 additions and 19 deletions
|
|
@ -117,9 +117,7 @@ impl Download {
|
|||
|
||||
pub fn start(&mut self) -> Task<Update> {
|
||||
match self.state {
|
||||
State::Idle { .. }
|
||||
| State::Finished { .. }
|
||||
| State::Errored { .. } => {
|
||||
State::Idle | State::Finished | State::Errored => {
|
||||
let (task, handle) = Task::sip(
|
||||
download(
|
||||
"https://huggingface.co/\
|
||||
|
|
@ -161,10 +159,10 @@ impl Download {
|
|||
|
||||
pub fn view(&self) -> Element<Message> {
|
||||
let current_progress = match &self.state {
|
||||
State::Idle { .. } => 0.0,
|
||||
State::Idle => 0.0,
|
||||
State::Downloading { progress, .. } => *progress,
|
||||
State::Finished { .. } => 100.0,
|
||||
State::Errored { .. } => 0.0,
|
||||
State::Finished => 100.0,
|
||||
State::Errored => 0.0,
|
||||
};
|
||||
|
||||
let progress_bar = progress_bar(0.0..=100.0, current_progress);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ impl Pokedex {
|
|||
let subtitle = match self {
|
||||
Pokedex::Loading => "Loading",
|
||||
Pokedex::Loaded { pokemon, .. } => &pokemon.name,
|
||||
Pokedex::Errored { .. } => "Whoops!",
|
||||
Pokedex::Errored => "Whoops!",
|
||||
};
|
||||
|
||||
format!("{subtitle} - Pokédex")
|
||||
|
|
|
|||
|
|
@ -327,9 +327,10 @@ mod toast {
|
|||
instants.truncate(new);
|
||||
}
|
||||
(old, new) if old < new => {
|
||||
instants.extend(
|
||||
std::iter::repeat(Some(Instant::now())).take(new - old),
|
||||
);
|
||||
instants.extend(std::iter::repeat_n(
|
||||
Some(Instant::now()),
|
||||
new - old,
|
||||
));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue