mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
fix panic on negative counter value update
This commit is contained in:
parent
7014df051c
commit
3eca182ddf
4 changed files with 6 additions and 5 deletions
|
|
@ -36,7 +36,7 @@ impl Control {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<usize>) {
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<isize>) {
|
||||
// Update children components
|
||||
self.counter.update(is_empty, bytes_left);
|
||||
self.send.update(match bytes_left {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl Counter {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<usize>) {
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<isize>) {
|
||||
self.widget.update(is_empty, bytes_left);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl Widget {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<usize>) {
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<isize>) {
|
||||
match bytes_left {
|
||||
Some(value) => {
|
||||
// Update color on chars left reached
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue