From ed72a2e16ece757941786f586bd2a80022892a74 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 15 Aug 2022 12:07:30 +0200 Subject: Add derive of `Eq` where possible --- src/event.rs | 12 ++++++------ src/lib.rs | 2 +- src/resolve.rs | 2 +- src/state.rs | 4 ++-- src/tokenizer.rs | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/event.rs b/src/event.rs index 09973e7..ab91a25 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,5 +1,5 @@ /// Semantic label of a span. -#[derive(Debug, Clone, PartialEq, Hash, Eq)] +#[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum Name { /// Attention sequence. /// @@ -1877,7 +1877,7 @@ pub const VOID_EVENTS: [Name; 40] = [ ]; /// Embedded content type. -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum Content { /// Represents [flow content][crate::construct::flow]. Flow, @@ -1888,7 +1888,7 @@ pub enum Content { } /// Link to another event. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Link { pub previous: Option, pub next: Option, @@ -1899,7 +1899,7 @@ pub struct Link { /// /// The interface for the location in the document comes from unist `Point`: /// . -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Point { /// 1-indexed line number. pub line: usize, @@ -1917,7 +1917,7 @@ pub struct Point { } /// Event kinds. -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum Kind { /// The start of something. Enter, @@ -1926,7 +1926,7 @@ pub enum Kind { } /// Something semantic happening somewhere. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Event { /// Kind of event. pub kind: Kind, diff --git a/src/lib.rs b/src/lib.rs index d46a6db..4de633c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ use crate::compiler::compile; use crate::parser::parse; /// Type of line endings in markdown. -#[derive(Debug, Default, Clone, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] pub enum LineEnding { /// Both a carriage return (`\r`) and a line feed (`\n`). /// diff --git a/src/resolve.rs b/src/resolve.rs index 0bf62fe..1106880 100644 --- a/src/resolve.rs +++ b/src/resolve.rs @@ -2,7 +2,7 @@ use crate::construct; use crate::tokenizer::Tokenizer; /// Names of functions that resolve. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Name { Label, Attention, diff --git a/src/state.rs b/src/state.rs index 105cade..aae153f 100644 --- a/src/state.rs +++ b/src/state.rs @@ -2,7 +2,7 @@ use crate::construct; use crate::tokenizer::Tokenizer; /// The result of a state. -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum State { /// Move to [`Name`][] next. Next(Name), @@ -15,7 +15,7 @@ pub enum State { } /// Names of functions to move to. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[allow(clippy::enum_variant_names)] pub enum Name { AttentionStart, diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 5b5e311..d66e8f6 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -102,7 +102,7 @@ struct Attempt { /// The internal state of a tokenizer, not to be confused with states from the /// state machine, this instead is all the information about where we currently /// are and what’s going on. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] struct Progress { /// Length of `events`. /// -- cgit