Skip to content

Commit a5bdfb6

Browse files
committed
Remove implementation of traits that can confuse users because of lack well-defining meaning
1 parent 36a2c52 commit a5bdfb6

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@
2020

2121
### Bug Fixes
2222

23+
- [#1007]: Remove error-prone implementations of `Hash`, `PartialOrd`, and `Ord` from all
24+
events except `BytesText` and `BytesCData`, which was introduced in [#1005].
25+
2326
### Misc Changes
2427

28+
[#1005]: https://github.com/tafia/quick-xml/pull/1005
29+
[#1007]: https://github.com/tafia/quick-xml/pull/1007
30+
2531

2632
## 0.42.0 -- 2026-08-22
2733

src/events/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ use attributes::{AttrError, Attribute, Attributes};
9595
/// [`local_name`]: Self::local_name
9696
/// [`attributes`]: Self::attributes
9797
/// [`.into_owned()`]: Self::into_owned
98-
#[derive(Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
98+
#[derive(Clone, Eq, PartialEq)]
9999
pub struct BytesStart<'i> {
100100
/// content of the element
101101
pub(crate) buf: Cow<'i, str>,
@@ -399,7 +399,7 @@ impl<'i> arbitrary::Arbitrary<'i> for BytesStart<'i> {
399399
/// [`name`]: Self::name
400400
/// [`local_name`]: Self::local_name
401401
/// [`.into_owned()`]: Self::into_owned
402-
#[derive(Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
402+
#[derive(Clone, Eq, PartialEq)]
403403
pub struct BytesEnd<'i> {
404404
name: Cow<'i, str>,
405405
}
@@ -1043,7 +1043,7 @@ impl FusedIterator for CDataIterator<'_> {}
10431043
///
10441044
/// [PI]: https://www.w3.org/TR/xml11/#sec-pi
10451045
/// [`.into_owned()`]: Self::into_owned
1046-
#[derive(Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
1046+
#[derive(Clone, Eq, PartialEq)]
10471047
pub struct BytesPI<'i> {
10481048
content: BytesStart<'i>,
10491049
}
@@ -1228,7 +1228,7 @@ impl<'i> arbitrary::Arbitrary<'i> for BytesPI<'i> {
12281228
/// using [`.into_owned()`].
12291229
///
12301230
/// [`.into_owned()`]: Self::into_owned
1231-
#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
1231+
#[derive(Clone, Debug, Eq, PartialEq)]
12321232
pub struct BytesDecl<'i> {
12331233
content: BytesStart<'i>,
12341234
}
@@ -1586,7 +1586,7 @@ impl<'i> arbitrary::Arbitrary<'i> for BytesDecl<'i> {
15861586
/// using [`.into_owned()`].
15871587
///
15881588
/// [`.into_owned()`]: Self::into_owned
1589-
#[derive(Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
1589+
#[derive(Clone, Eq, PartialEq)]
15901590
pub struct BytesRef<'i> {
15911591
content: Cow<'i, str>,
15921592
}
@@ -1777,7 +1777,7 @@ impl<'i> arbitrary::Arbitrary<'i> for BytesRef<'i> {
17771777
///
17781778
/// [`Reader::read_event_into`]: crate::reader::Reader::read_event_into
17791779
/// [`.into_owned()`]: Self::into_owned
1780-
#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
1780+
#[derive(Clone, Debug, Eq, PartialEq)]
17811781
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
17821782
pub enum Event<'i> {
17831783
/// Start tag (with attributes) `<tag attr="value">`.

0 commit comments

Comments
 (0)