Commit 3eff946d authored by Andreas Hindborg's avatar Andreas Hindborg Committed by Miguel Ojeda
Browse files

rust: str: implement `PartialEq` for `BStr`

parent 3ba83d37
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -108,6 +108,12 @@ fn deref(&self) -> &Self::Target {
    }
}

impl PartialEq for BStr {
    fn eq(&self, other: &Self) -> bool {
        self.deref().eq(other.deref())
    }
}

/// Creates a new [`BStr`] from a string literal.
///
/// `b_str!` converts the supplied string literal to byte string, so non-ASCII