aboutsummaryrefslogtreecommitdiff
path: root/src/token.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-09-01 09:06:44 +0200
committerMartin Fischer <martin@push-f.com>2023-09-28 10:36:08 +0200
commitc75dce875cff03e59ec7b6bceed4ec63283a6477 (patch)
treef478ed26b04a965cd3e5fb1604ed204187cc64be /src/token.rs
parentbd446b6123e0b077a48e9f1e836affac78822f44 (diff)
feat: impl Clone for Token & Event
Diffstat (limited to 'src/token.rs')
-rw-r--r--src/token.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/token.rs b/src/token.rs
index 4f3c0ce..45c8123 100644
--- a/src/token.rs
+++ b/src/token.rs
@@ -5,7 +5,7 @@ use std::iter::FromIterator;
use std::ops::Index;
/// A type for the tokens emitted by a WHATWG-compliant HTML tokenizer.
-#[derive(Debug, Eq, PartialEq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Token {
/// A literal character, a resolved character reference,
/// or part of a resolved character reference (since some
@@ -24,7 +24,7 @@ pub enum Token {
}
/// An HTML start tag, such as `<p>` or `<a>`.
-#[derive(Debug, Eq, PartialEq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
pub struct StartTag {
/// Whether this tag is self-closing. If it is self-closing, no following [`EndTag`] should be
/// expected.
@@ -41,7 +41,7 @@ pub struct StartTag {
}
/// An HTML end/close tag, such as `</p>` or `</a>`.
-#[derive(Debug, Eq, PartialEq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EndTag {
/// The tag name.
/// Uppercase ASCII characters (A-Z) have been converted to lowercase.
@@ -54,7 +54,7 @@ pub struct EndTag {
/// * `<!DOCTYPE {name} PUBLIC '{public_id}'>`
/// * `<!DOCTYPE {name} SYSTEM '{system_id}'>`
/// * `<!DOCTYPE {name} PUBLIC '{public_id}' '{system_id}'>`
-#[derive(Debug, Eq, PartialEq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Doctype {
/// The [force-quirks flag].
///
@@ -86,14 +86,14 @@ pub struct Doctype {
/// .collect();
/// assert_eq!(&attrs["href"], "http://example.com");
/// ```
-#[derive(Debug, Default, PartialEq, Eq)]
+#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct AttributeMap {
pub(crate) inner: BTreeMap<String, AttrInternal>,
}
/// The value type internally used by the [`AttributeMap`].
/// Not part of the public API.
-#[derive(Default, Debug, Eq)]
+#[derive(Clone, Default, Debug, Eq)]
pub(crate) struct AttrInternal {
pub value: String,
pub trace_idx: Option<AttributeTraceIdx>,