Handle insufficient arguments using panic!

This commit is contained in:
Manuel Thalmann 2025-03-19 00:17:59 +01:00
parent bc20afefa1
commit dd00502383
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -22,6 +22,10 @@ struct Config {
impl Config {
fn new(args: &[String]) -> Config {
if args.len() < 3 {
panic!("not enough arguments");
}
let query = args[1].clone();
let file_path = args[2].clone();