Skip to content

Commit fbd193e

Browse files
committed
Removed manual implementation of PartialEq, and oundtrip_unnormalized_fixtures test now uses pre-formatted messages that are expected with the correct spans
1 parent e25b189 commit fbd193e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1490
-267
lines changed

fluent-syntax/src/ast/helper.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use serde::{Deserialize, Serialize};
77
// This is a helper struct used to properly deserialize referential
88
// JSON comments which are single continuous String, into a vec of
99
// content slices.
10-
#[derive(Debug, Clone)]
11-
#[cfg_attr(not(feature = "spans"), derive(PartialEq, Eq))]
10+
#[derive(Debug, Clone, PartialEq)]
1211
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312
#[cfg_attr(feature = "serde", serde(untagged))]
1413
pub enum CommentDef<S> {
@@ -24,20 +23,6 @@ pub enum CommentDef<S> {
2423
},
2524
}
2625

27-
#[cfg(feature = "spans")]
28-
impl<S: Eq> Eq for CommentDef<S> {}
29-
30-
#[cfg(feature = "spans")]
31-
impl<S: PartialEq> PartialEq for CommentDef<S> {
32-
fn eq(&self, other: &Self) -> bool {
33-
match (self, other) {
34-
(Self::Single { content: l_content, .. }, Self::Single { content: r_content, .. }) => l_content == r_content,
35-
(Self::Multi { content: l_content, .. }, Self::Multi { content: r_content, .. }) => l_content == r_content,
36-
_ => false,
37-
}
38-
}
39-
}
40-
4126
impl<S> From<CommentDef<S>> for Comment<S> {
4227
fn from(input: CommentDef<S>) -> Self {
4328
match input {

0 commit comments

Comments
 (0)