From 02daca87dcd3a098d0c85b5021949a8e731d2947 Mon Sep 17 00:00:00 2001 From: emma Date: Wed, 5 Jun 2024 11:55:16 -0600 Subject: [PATCH] fop(1): updated to latest optind api --- src/fop.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fop.rs b/src/fop.rs index 8ffb447..e0bba4c 100644 --- a/src/fop.rs +++ b/src/fop.rs @@ -44,13 +44,13 @@ fn main() { Ok(o) => { /* unwrap because Err(OptError::MissingArg) will be returned if * o.arg is None */ - let arg = o.arg.unwrap(); + let arg = o.arg.clone().unwrap(); let arg_char = arg.chars().collect::>(); if arg_char.len() > 1 { eprintln!("{}: {}: Not a character.", argv[0], arg); exit(EX_USAGE); } else { d = arg_char[0]; } - unsafe { index_arg = *o.ind as usize; } + index_arg = o.index(); }, Err(_) => { eprintln!("{}", usage);