fn cmp(&self, other: &Self) -> Ordering {
        let Self(self_code, self_messages) = self;
        let Self(other_code, other_messages) = other;
        let (self_first, other_first) = match (self_messages.first(), other_messages.first()) {
            (None, None) => return Ordering::Equal,
            (Some(_), None) => return Ordering::Greater,
            (None, Some(_)) => return Ordering::Less,
            (Some(self_first), Some(other_first)) => (self_first, other_first),
        };
        let (self_pos, self_msg) = self_first;
        let (other_pos, other_msg) = other_first;
        // The primary sort order is the position of the first message.
        self_pos.cmp(other_pos)
            // If the positions are the same, sort by error code.
            .then((*self_code as isize).cmp(&(*other_code as isize)))
            // If the error codes are the same, sort by message text.
            .then(self_msg.cmp(other_msg))
            // If the first message text is the same, compare the rest of the
            // messages (which contain further explanation for the error
            // reported in the first message).
            .then(self_messages.iter().skip(1).cmp(other_messages.iter().skip(1)))
    }
// Intended to match the implementation of `compare` in `Errors.sort` in OCaml.
Intended to match the implementation of `compare` in `Errors.sort` in OCaml.
Intended to match the implementation of ` compare ` in ` Errors . sort ` in OCaml .
fn cmp(&self, other: &Self) -> Ordering {
        let Self(self_code, self_messages) = self;
        let Self(other_code, other_messages) = other;
        let (self_first, other_first) = match (self_messages.first(), other_messages.first()) {
            (None, None) => return Ordering::Equal,
            (Some(_), None) => return Ordering::Greater,
            (None, Some(_)) => return Ordering::Less,
            (Some(self_first), Some(other_first)) => (self_first, other_first),
        };
        let (self_pos, self_msg) = self_first;
        let (other_pos, other_msg) = other_first;
        // The primary sort order is the position of the first message.
        self_pos.cmp(other_pos)
            // If the positions are the same, sort by error code.
            .then((*self_code as isize).cmp(&(*other_code as isize)))
            // If the error codes are the same, sort by message text.
            .then(self_msg.cmp(other_msg))
            // If the first message text is the same, compare the rest of the
            // messages (which contain further explanation for the error
            // reported in the first message).
            .then(self_messages.iter().skip(1).cmp(other_messages.iter().skip(1)))
    }
fn cmp ( & self , other : & Self ) -> Ordering { let Self ( self_code , self_messages ) = self ; let Self ( other_code , other_messages ) = other ; let ( self_first , other_first ) = match ( self_messages . first ( ) , other_messages . first ( ) ) { ( None , None ) => return Ordering :: Equal , ( Some ( _ ) , None ) => return Ordering :: Greater , ( None , Some ( _ ) ) => return Ordering :: Less , ( Some ( self_first ) , Some ( other_first ) ) => ( self_first , other_first ) , } ; let ( self_pos , self_msg ) = self_first ; let ( other_pos , other_msg ) = other_first ; // The primary sort order is the position of the first message. self_pos . cmp ( other_pos ) // If the positions are the same, sort by error code. . then ( ( * self_code as isize ) . cmp ( & ( * other_code as isize ) ) ) // If the error codes are the same, sort by message text. . then ( self_msg . cmp ( other_msg ) ) // If the first message text is the same, compare the rest of the // messages (which contain further explanation for the error // reported in the first message). . then ( self_messages . iter ( ) . skip ( 1 ) . cmp ( other_messages . iter ( ) . skip ( 1 ) ) ) }
Intended to match the implementation of `compare` in `Errors.sort` in OCaml.
Intended to match the implementation of ` compare ` in ` Errors . sort ` in OCaml .
&self
other
&Self