switched from Duration struct to u64

This commit is contained in:
djaidjai committed 2023-05-10 14:39:36 +02:00
1 parent 3722cd364d
commit 01bd29d021
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -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),
+2 -2
View File
@@ -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,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.