chore: lints moved from main.rs to Cargo.toml

This commit is contained in:
Jack Wills
2023-11-19 22:48:40 +00:00
parent 37d2ee9156
commit 2de76e2f35
2 changed files with 19 additions and 17 deletions
+14
View File
@@ -11,6 +11,20 @@ readme = "README.md"
keywords = ["docker", "tui", "tokio", "terminal", "podman"]
categories = ["command-line-utilities"]
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
expect_used = "warn"
nursery = "warn"
pedantic ="warn"
todo = "warn"
unused_async = "warn"
unwrap_used = "warn"
module_name_repetitions = "allow"
doc_markdown = "allow"
similar_names = "allow"
[dependencies]
anyhow = "1.0"
# bollard = "0.15"
+5 -17
View File
@@ -1,19 +1,5 @@
#![forbid(unsafe_code)]
#![warn(
clippy::expect_used,
clippy::nursery,
clippy::pedantic,
clippy::todo,
clippy::unused_async,
clippy::unwrap_used
)]
#![allow(
clippy::module_name_repetitions,
clippy::doc_markdown,
clippy::similar_names
)]
// Only allow when debugging
#![allow(unused)]
// #![allow(unused)]
use app_data::AppData;
use app_error::AppError;
@@ -123,6 +109,8 @@ async fn main() {
let args = CliArgs::new();
// If running via Docker image, need to sleep else program will just quit straight away, no real idea why
// So just sleep for small while
if args.in_container {
std::thread::sleep(std::time::Duration::from_millis(250));
}
@@ -144,9 +132,9 @@ async fn main() {
.await;
if args.gui {
let (input_sx, input_rx) = tokio::sync::mpsc::channel(32);
let (sx, input_rx) = tokio::sync::mpsc::channel(32);
handler_init(&app_data, &docker_tx, &gui_state, input_rx, &is_running);
Ui::create(app_data, docker_tx.clone(), gui_state, is_running, input_sx).await;
Ui::create(app_data, gui_state, is_running, sx).await;
} else {
info!("in debug mode\n");
// Debug mode for testing, less pointless now, will display some basic information