aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-15 12:07:30 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-15 12:07:30 +0200
commited72a2e16ece757941786f586bd2a80022892a74 (patch)
treeea0e93ab6daca1ef4c76d62bd311349dc12a86ee
parentee967aa634b5f8e9d30329d587538f1371a5da95 (diff)
downloadmarkdown-rs-ed72a2e16ece757941786f586bd2a80022892a74.tar.gz
markdown-rs-ed72a2e16ece757941786f586bd2a80022892a74.tar.bz2
markdown-rs-ed72a2e16ece757941786f586bd2a80022892a74.zip
Add derive of `Eq` where possible
-rw-r--r--src/event.rs12
-rw-r--r--src/lib.rs2
-rw-r--r--src/resolve.rs2
-rw-r--r--src/state.rs4
-rw-r--r--src/tokenizer.rs2
5 files changed, 11 insertions, 11 deletions
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<usize>,
pub next: Option<usize>,
@@ -1899,7 +1899,7 @@ pub struct Link {
///
/// The interface for the location in the document comes from unist `Point`:
/// <https://github.com/syntax-tree/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`.
///