diff --git a/src/swab.rs b/src/swab.rs index 5b4c173..8573cea 100644 --- a/src/swab.rs +++ b/src/swab.rs @@ -1,5 +1,6 @@ /* * Copyright (c) 2024 DTB + * Copyright (c) 2024 Emma Tebibyte * SPDX-License-Identifier: AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify it under @@ -54,12 +55,10 @@ fn main() -> ExitCode { while let Some(opt) = argv.getopt(":w:") { match opt.opt() { Ok("w") => { - if let Some(arg) = opt.arg() { - match arg.parse::() { - Ok(w) if w % 2 == 0 => { wordsize = w; () }, + match opt.arg().unwrap().parse::() { + Ok(w) if w % 2 == 0 => { wordsize = w; }, _ => { return usage(&argv[0]); }, } - } optind = opt.ind(); }, _ => { return usage(&argv[0]); }