mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-02 11:11:04 +02:00
refactor: general code tidy-up
This commit is contained in:
parent
5e21cbcca6
commit
ea2c84d1bd
4 changed files with 15 additions and 18 deletions
|
@ -131,8 +131,10 @@ impl From<&str> for Script {
|
|||
.take_while(|c| c.is_ascii_digit())
|
||||
.collect::<String>();
|
||||
|
||||
// TODO: Handle this better than panicking
|
||||
let interval = interval_str.parse::<u64>().expect("Invalid interval");
|
||||
let interval = interval_str.parse::<u64>().unwrap_or_else(|_| {
|
||||
warn!("Received invalid interval in script string. Falling back to default `5000ms`.");
|
||||
5000
|
||||
});
|
||||
(ScriptInputToken::Interval(interval), interval_str.len())
|
||||
}
|
||||
// watching or polling
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue