pub fn next_arg(&mut self) -> Option<&'a str> {
        if let Some(cur) = self.cur.take() {
            let arg = cur.as_str();

            if !arg.is_empty() {
                return Some(arg);
            }
        }

        // we peak the arg to not immediately
        // remove it from the iterator
        // we want to see if its another option
        // like '-a' or '--something'. If so
        // we return None because
        // this next_arg should not be the next --option
        // otherwise, we actually call self.args.next()
        let argnext = self.args.peek();
        match argnext {
            None => self.args.next().map(|s| s.as_ref()),
            Some(s) => {
                let s_ref = s.as_ref();
                if s_ref.starts_with('-') {
                    None
                } else {
                    self.args.next().map(|s| s.as_ref())
                }
            }
        }
    }
/// Returns the next argument to an option or `None` if none remain.
Returns the next argument to an option or `None` if none remain.
Returns the next argument to an option or ` None ` if none remain .
pub fn next_arg(&mut self) -> Option<&'a str> {
        if let Some(cur) = self.cur.take() {
            let arg = cur.as_str();
            if !arg.is_empty() {
                return Some(arg);
            }
        }
        // we peak the arg to not immediately
        // remove it from the iterator
        // we want to see if its another option
        // like '-a' or '--something'. If so
        // we return None because
        // this next_arg should not be the next --option
        // otherwise, we actually call self.args.next()
        let argnext = self.args.peek();
        match argnext {
            None => self.args.next().map(|s| s.as_ref()),
            Some(s) => {
                let s_ref = s.as_ref();
                if s_ref.starts_with('-') {
                    None
                } else {
                    self.args.next().map(|s| s.as_ref())
                }
            }
        }
    }
pub fn next_arg ( & mut self ) -> Option < & ' a str > { if let Some ( cur ) = self . cur . take ( ) { let arg = cur . as_str ( ) ; if ! arg . is_empty ( ) { return Some ( arg ) ; } } // we peak the arg to not immediately // remove it from the iterator // we want to see if its another option // like '-a' or '--something'. If so // we return None because // this next_arg should not be the next --option // otherwise, we actually call self.args.next() let argnext = self . args . peek ( ) ; match argnext { None => self . args . next ( ) . map ( | s | s . as_ref ( ) ) , Some ( s ) => { let s_ref = s . as_ref ( ) ; if s_ref . starts_with ( '-' ) { None } else { self . args . next ( ) . map ( | s | s . as_ref ( ) ) } } } }
Returns the next argument to an option or `None` if none remain.
Returns the next argument to an option or ` None ` if none remain .
&mut self
&mut self