Compare commits

..

1 Commits

Author SHA1 Message Date
ad00301ac9 docs(rust-style): order declarations by dependency 2026-09-19 17:38:09 -04:00

View File

@@ -5,7 +5,9 @@ use std::process::ExitCode;
use xatu::{Report, SourceFile};
fn main() -> ExitCode {
match analyze(Args::parse()) {
let args = Args::parse();
match analyze(args) {
Ok(report) if report.is_clean() => {
println!("No findings.");
ExitCode::SUCCESS
@@ -21,6 +23,12 @@ fn main() -> ExitCode {
}
}
#[derive(Debug, Parser)]
struct Args {
#[arg(value_name = "PATH", default_value = ".")]
paths: Vec<PathBuf>,
}
fn analyze(args: Args) -> status::Result<Report> {
let paths: Vec<PathBuf> = args
.paths
@@ -39,12 +47,6 @@ fn analyze(args: Args) -> status::Result<Report> {
xatu::future_sight(files)
}
#[derive(Debug, Parser)]
struct Args {
#[arg(value_name = "PATH", default_value = ".")]
paths: Vec<PathBuf>,
}
fn collect_source_files(path: &Path) -> status::Result<Vec<SourceFile>> {
let metadata = std::fs::symlink_metadata(path)
.with_context(|| format!("failed to read metadata for {}", path.display()))?;