pub fn merge(self, other: CommandParseRes<Res>) -> CommandParseRes<Res> {
        match (self, other) {
            (me @ CommandParseRes::Parsed(_), _other) => me,
            (_me, other @ CommandParseRes::Parsed(_)) => other,
            (
                CommandParseRes::Failed {
                    parsed_up_to: me_parsed_up_to,
                    reason: me_reason,
                },
                CommandParseRes::Failed {
                    parsed_up_to: other_parsed_up_to,
                    reason: other_reason,
                },
            ) => match (me_parsed_up_to, me_reason.merge_preference_order())
                .cmp(&(
                    other_parsed_up_to,
                    other_reason.merge_preference_order(),
                )) {
                Ordering::Less => CommandParseRes::Failed {
                    parsed_up_to: other_parsed_up_to,
                    reason: other_reason,
                },
                Ordering::Greater => CommandParseRes::Failed {
                    parsed_up_to: me_parsed_up_to,
                    reason: me_reason,
                },
                Ordering::Equal => match (me_reason, other_reason) {
                    (
                        CommandParseFailure::ExpectedArg {
                            index: me_index,
                            hint: mut me_hint,
                        },
                        CommandParseFailure::ExpectedArg {
                            index: other_index,
                            hint: mut other_hint,
                        },
                    ) => {
                        debug_assert!(
                            me_index == other_index,
                            "`CommandParseRes::merge()` was given two \
                             `CommandParseRes::ExpectedArg` values with \
                             different `index` values.  This should not happen \
                             and is not supported."
                        );
                        me_hint.append(&mut other_hint);
                        CommandParseRes::Failed {
                            parsed_up_to: me_parsed_up_to,
                            reason: CommandParseFailure::ExpectedArg {
                                index: me_index,
                                hint: me_hint,
                            },
                        }
                    }
                    (me_reason, _other_reason) => CommandParseRes::Failed {
                        parsed_up_to: me_parsed_up_to,
                        reason: me_reason,
                    },
                },
            },
        }
    }
/// Combines two `CommandParseRes` results, giving `self` preference in case
/// they are considered equal.
///
/// `Parsed` is preferred over any kind of failure.  One failure is
/// preferred over another if the first happened at a later position.
///
/// If both are [`CommandParseFailure::ExpectedArg`] and they failed at the
/// same character, then we would produce a combined version that will
/// contain `hint` values from both errors.
Combines two `CommandParseRes` results, giving `self` preference in case
they are considered equal.

`Parsed` is preferred over any kind of failure.  One failure is
preferred over another if the first happened at a later position.

If both are [`CommandParseFailure::ExpectedArg`] and they failed at the
same character, then we would produce a combined version that will
contain `hint` values from both errors.
Combines two ` CommandParseRes ` results giving ` self ` preference in case they are considered equal . ` Parsed ` is preferred over any kind of failure . One failure is preferred over another if the first happened at a later position . If both are [ ` CommandParseFailure :: ExpectedArg ` ] and they failed at the same character then we would produce a combined version that will contain ` hint ` values from both errors .
pub fn merge(self, other: CommandParseRes<Res>) -> CommandParseRes<Res> {
        match (self, other) {
            (me @ CommandParseRes::Parsed(_), _other) => me,
            (_me, other @ CommandParseRes::Parsed(_)) => other,
            (
                CommandParseRes::Failed {
                    parsed_up_to: me_parsed_up_to,
                    reason: me_reason,
                },
                CommandParseRes::Failed {
                    parsed_up_to: other_parsed_up_to,
                    reason: other_reason,
                },
            ) => match (me_parsed_up_to, me_reason.merge_preference_order())
                .cmp(&(
                    other_parsed_up_to,
                    other_reason.merge_preference_order(),
                )) {
                Ordering::Less => CommandParseRes::Failed {
                    parsed_up_to: other_parsed_up_to,
                    reason: other_reason,
                },
                Ordering::Greater => CommandParseRes::Failed {
                    parsed_up_to: me_parsed_up_to,
                    reason: me_reason,
                },
                Ordering::Equal => match (me_reason, other_reason) {
                    (
                        CommandParseFailure::ExpectedArg {
                            index: me_index,
                            hint: mut me_hint,
                        },
                        CommandParseFailure::ExpectedArg {
                            index: other_index,
                            hint: mut other_hint,
                        },
                    ) => {
                        debug_assert!(
                            me_index == other_index,
                            "`CommandParseRes::merge()` was given two \
                             `CommandParseRes::ExpectedArg` values with \
                             different `index` values.  This should not happen \
                             and is not supported."
                        );
                        me_hint.append(&mut other_hint);
                        CommandParseRes::Failed {
                            parsed_up_to: me_parsed_up_to,
                            reason: CommandParseFailure::ExpectedArg {
                                index: me_index,
                                hint: me_hint,
                            },
                        }
                    }
                    (me_reason, _other_reason) => CommandParseRes::Failed {
                        parsed_up_to: me_parsed_up_to,
                        reason: me_reason,
                    },
                },
            },
        }
    }
pub fn merge ( self , other : CommandParseRes < Res > ) -> CommandParseRes < Res > { match ( self , other ) { ( me @ CommandParseRes :: Parsed ( _ ) , _other ) => me , ( _me , other @ CommandParseRes :: Parsed ( _ ) ) => other , ( CommandParseRes :: Failed { parsed_up_to : me_parsed_up_to , reason : me_reason , } , CommandParseRes :: Failed { parsed_up_to : other_parsed_up_to , reason : other_reason , } , ) => match ( me_parsed_up_to , me_reason . merge_preference_order ( ) ) . cmp ( & ( other_parsed_up_to , other_reason . merge_preference_order ( ) , ) ) { Ordering :: Less => CommandParseRes :: Failed { parsed_up_to : other_parsed_up_to , reason : other_reason , } , Ordering :: Greater => CommandParseRes :: Failed { parsed_up_to : me_parsed_up_to , reason : me_reason , } , Ordering :: Equal => match ( me_reason , other_reason ) { ( CommandParseFailure :: ExpectedArg { index : me_index , hint : mut me_hint , } , CommandParseFailure :: ExpectedArg { index : other_index , hint : mut other_hint , } , ) => { debug_assert ! ( me_index other_index " \
 \
 \
 " ) ; me_hint . append ( & mut other_hint ) ; CommandParseRes :: Failed { parsed_up_to : me_parsed_up_to , reason : CommandParseFailure :: ExpectedArg { index : me_index , hint : me_hint , } , } } ( me_reason , _other_reason ) => CommandParseRes :: Failed { parsed_up_to : me_parsed_up_to , reason : me_reason , } , } , } , } }
Combines two `CommandParseRes` results, giving `self` preference in case
they are considered equal.
Combines two ` CommandParseRes ` results giving ` self ` preference in case they are considered equal .
self
other
CommandParseRes<Res>