From 5b82c7548023ce081a205cf0a6c57c727b75ae3f Mon Sep 17 00:00:00 2001 From: JasterV <49537445+JasterV@users.noreply.github.com> Date: Fri, 6 Mar 2026 23:31:42 +0100 Subject: [PATCH] chore: Add Makefile --- Makefile.toml | 47 ++++++++++++++++++++++++++++++++++ examples/todo-list/src/view.rs | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Makefile.toml diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..1dba5a3 --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,47 @@ +[config] +default_to_workspace = false + +[tasks.build] +description = "Build binaries" +command = "cargo" +args = ["build", "--workspace", "--all-features"] + +[tasks.clippy] +description = "Runs clippy." +clear = true +command = "cargo" +args = [ + "clippy", + "--all-targets", + "--workspace", + "--", + "-D", + "warnings", + "-W", + "clippy::dbg_macro", +] + +[tasks.fmt-check] +description = "Runs the cargo rustfmt plugin during CI." +command = "cargo" +args = ["fmt", "--all", "--", "--check"] + +[tasks.deny-check] +description = "Runs the cargo deny plugin during CI." +command = "cargo" +args = ["deny", "check"] + +[tasks.test] +description = "Runs tests." +clear = true +run_task = { name = ["doc-tests", "nextest"], fork = true } + +[tasks.nextest] +description = "Runs tests without dependencies." +command = "cargo" +args = ["nextest", "run", "--no-fail-fast", "${@}"] + +[tasks.doc-tests] +description = "Run doc tests" +command = "cargo" +args = ["test", "--doc"] diff --git a/examples/todo-list/src/view.rs b/examples/todo-list/src/view.rs index cd6c9be..896a5da 100644 --- a/examples/todo-list/src/view.rs +++ b/examples/todo-list/src/view.rs @@ -120,7 +120,7 @@ impl AppWidget { } const fn alternate_colors(i: usize) -> Color { - if i % 2 == 0 { + if i.is_multiple_of(2) { NORMAL_ROW_BG } else { ALT_ROW_BG_COLOR