fix warns, simplify, begin watcher
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
i do not exist 2026-07-30 16:38:45 +03:00
parent b4424fcb69
commit ba8ff1ae69
23 changed files with 1737 additions and 1689 deletions

View file

@ -1,4 +1,4 @@
use crate::{*, browse::*, device::*, menu::*};
use crate::{*, device::*};
/// Various possible dialog modes.
///
@ -127,3 +127,19 @@ impl Dialog {
/// FIXME: implement
pub fn browser_target (&self) -> Option<&BrowseTarget> { todo!() }
}
/// Increment a wrapping counter.
pub const fn wrap_inc (index: usize, count: usize) -> usize {
if count > 0 { (index + 1) % count } else { 0 }
}
/// Decrement a wrapping counter.
pub const fn wrap_dec (index: usize, count: usize) -> usize {
if count > 0 {
let a = index.overflowing_sub(1).0;
let b = count.saturating_sub(1);
if a < b { a } else { b }
} else {
0
}
}