1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00
Files
egui/xtask/src/main.rs
Emil Ernerfeldt 6aea7eff94 Enable the clippy::std_instead_of_core lint (#8394)
Prefer `core::` over `std::` where either work

* Part of https://github.com/emilk/egui/issues/5735
2026-08-06 13:19:13 +02:00

42 lines
912 B
Rust

//! Helper crate for running scripts within the `egui` repo
#![expect(clippy::print_stderr, clippy::print_stdout)]
#![allow(clippy::exit)]
mod deny;
pub(crate) mod utils;
type DynError = Box<dyn core::error::Error>;
fn main() {
if let Err(e) = try_main() {
eprintln!("{e}");
std::process::exit(-1);
}
}
fn try_main() -> Result<(), DynError> {
let arg_strings: Vec<_> = std::env::args().skip(1).collect();
let args: Vec<_> = arg_strings.iter().map(String::as_str).collect();
match args.as_slice() {
&[] | &["-h"] | &["--help"] => print_help(),
&["deny", ..] => deny::deny(&args[1..])?,
c => Err(format!("Invalid arguments {c:?}"))?,
}
Ok(())
}
fn print_help() {
let help = "
xtask help
Subcommands
deny: Run cargo-deny for all targets
Options
-h, --help: print help and exit
";
println!("{help}");
}