fn process_sign_of(n: &str) -> Result<(&str, ByteOffsetKind), ByteOffsetParseError> {
    use ByteOffsetParseError::*;
    let mut chars = n.chars();
    let next_char = chars.next();
    let check_empty_after_sign = || {
        if chars.clone().next().is_none() {
            Err(EmptyAfterSign)
        } else {
            Ok(chars.as_str())
        }
    };
    match next_char {
        Some('+') => Ok((
            check_empty_after_sign()?,
            ByteOffsetKind::ForwardFromLastOffset,
        )),
        Some('-') => Ok((check_empty_after_sign()?, ByteOffsetKind::BackwardFromEnd)),
        None => Err(Empty),
        _ => Ok((n, ByteOffsetKind::ForwardFromBeginning)),
    }
}
/// Extracts a [ByteOffsetKind] based on the sign at the beginning of the given string.
/// Returns the input string without the sign (or an equal string if there wasn't any sign).
Extracts a [ByteOffsetKind] based on the sign at the beginning of the given string.
Returns the input string without the sign (or an equal string if there wasn't any sign).
Extracts a [ ByteOffsetKind ] based on the sign at the beginning of the given string . Returns the input string without the sign ( or an equal string if there wasn ' t any sign ) .
fn process_sign_of(n: &str) -> Result<(&str, ByteOffsetKind), ByteOffsetParseError> {
    use ByteOffsetParseError::*;
    let mut chars = n.chars();
    let next_char = chars.next();
    let check_empty_after_sign = || {
        if chars.clone().next().is_none() {
            Err(EmptyAfterSign)
        } else {
            Ok(chars.as_str())
        }
    };
    match next_char {
        Some('+') => Ok((
            check_empty_after_sign()?,
            ByteOffsetKind::ForwardFromLastOffset,
        )),
        Some('-') => Ok((check_empty_after_sign()?, ByteOffsetKind::BackwardFromEnd)),
        None => Err(Empty),
        _ => Ok((n, ByteOffsetKind::ForwardFromBeginning)),
    }
}
fn process_sign_of ( n : & str ) -> Result < ( & str , ByteOffsetKind ) , ByteOffsetParseError > { use ByteOffsetParseError :: * ; let mut chars = n . chars ( ) ; let next_char = chars . next ( ) ; let check_empty_after_sign = | | { if chars . clone ( ) . next ( ) . is_none ( ) { Err ( EmptyAfterSign ) } else { Ok ( chars . as_str ( ) ) } } ; match next_char { Some ( '+' ) => Ok ( ( check_empty_after_sign ( ) ? , ByteOffsetKind :: ForwardFromLastOffset , ) ) , Some ( '-' ) => Ok ( ( check_empty_after_sign ( ) ? , ByteOffsetKind :: BackwardFromEnd ) ) , None => Err ( Empty ) , _ => Ok ( ( n , ByteOffsetKind :: ForwardFromBeginning ) ) , } }
Extracts a [ByteOffsetKind] based on the sign at the beginning of the given string.
Extracts a [ ByteOffsetKind ] based on the sign at the beginning of the given string .
n
&str