Skip to content

Commit

Permalink
fixed: clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
massivebird committed Nov 29, 2024
1 parent 9cd6fa9 commit e8c611f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ impl App {

assert!(
Path::new(&config_path).exists(),
"Unable to locate config file at {}",
config_path,
"Unable to locate config file at {config_path}",
);

let Ok(config_contents) = std::fs::read_to_string(config_path.clone()) else {
panic!("Unable to read config file at {}", config_path);
panic!("Unable to read config file at {config_path}");
};

let Ok(yaml) = yaml_rust2::YamlLoader::load_from_str(&config_contents) else {
panic!("Failed to parse config file at {} into yaml.", config_path)
panic!("Failed to parse config file at {config_path} into yaml.")
};

let sites_yaml: &Yaml = &yaml[0]["sites"];
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fn commence_application<B: Backend>(
let sites = Arc::clone(&app.sites);

thread::spawn(move || loop {
for idx in 0..sites.lock().unwrap().len() {
let num_sites = sites.lock().unwrap().len();
for idx in 0..num_sites {
let sites = Arc::clone(&sites);

thread::spawn(move || {
Expand All @@ -86,10 +87,10 @@ fn commence_application<B: Backend>(
KeyCode::Char('l') => app.next_tab(),
KeyCode::Char('h') => app.prev_tab(),
KeyCode::Char('j') if app.selected_tab == SelectedTab::Chart => {
app.next_chart_site()
app.next_chart_site();
}
KeyCode::Char('k') if app.selected_tab == SelectedTab::Chart => {
app.prev_chart_site()
app.prev_chart_site();
}
_ => (),
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,5 @@ fn render_tab_chart(f: &mut Frame, app: &App) {
Rect::new(0, 1, f.area().width, f.area().height - 1),
);

f.render_widget(info, Rect::new(2, 1, f.area().width, f.area().height - 1))
f.render_widget(info, Rect::new(2, 1, f.area().width, f.area().height - 1));
}

0 comments on commit e8c611f

Please sign in to comment.