switched from Duration struct to u64
This commit is contained in:
parent
3722cd364d
commit
01bd29d021
|
|
@ -1,3 +1,4 @@
|
||||||
|
use core::time;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
@ -48,7 +49,8 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
thread::sleep(cfg.update_delay);
|
// thread::sleep(cfg.update_delay);
|
||||||
|
thread::sleep(time::Duration::from_millis(cfg.update_delay));
|
||||||
match cli.debug {
|
match cli.debug {
|
||||||
true => print_players(&pf),
|
true => print_players(&pf),
|
||||||
false => default_loop(&pf, &cfg, &mut data),
|
false => default_loop(&pf, &cfg, &mut data),
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,13 @@ pub struct Config {
|
||||||
pub rating_icons: Rating,
|
pub rating_icons: Rating,
|
||||||
pub metadata_fields: Vec<Field>,
|
pub metadata_fields: Vec<Field>,
|
||||||
pub player_prefixes: HashMap<String, char>,
|
pub player_prefixes: HashMap<String, char>,
|
||||||
pub update_delay: Duration,
|
pub update_delay: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Config {
|
Config {
|
||||||
update_delay: time::Duration::from_millis(300),
|
update_delay: 300_u64,
|
||||||
metadata_separator: "|".to_owned(),
|
metadata_separator: "|".to_owned(),
|
||||||
array_separator: '+',
|
array_separator: '+',
|
||||||
hide_output: true,
|
hide_output: true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue