aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Page <eopage@gmail.com>2023-03-08 10:53:10 -0600
committerGitHub <noreply@github.com>2023-03-08 16:53:10 +0000
commit8b415320df73b54808ae06d0bf22adcb7dc706ee (patch)
tree5ed3c2dc151303ab1eca51933190e452d542e856
parentdc861b1dae166183c66848fcbd47b8e81a43d972 (diff)
downloadr-alacritty-vte-8b415320df73b54808ae06d0bf22adcb7dc706ee.tar.gz
r-alacritty-vte-8b415320df73b54808ae06d0bf22adcb7dc706ee.tar.bz2
r-alacritty-vte-8b415320df73b54808ae06d0bf22adcb7dc706ee.zip
Add trivial derives to `utf8parser::Parser`
Much like `std::ops::Range`, we likely don't want this to be `Copy` as that makes it too easy to get mixed up on what state you are using but `Clone` should be explicit enough to be safe. `PartialOrd` / `Ord` were left off because there isn't really a user-facing ordering to these types `Hash` was left off as the use cases for it isn't clear.
-rw-r--r--utf8parse/src/lib.rs2
-rw-r--r--utf8parse/src/types.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/utf8parse/src/lib.rs b/utf8parse/src/lib.rs
index 947a0aa..093de81 100644
--- a/utf8parse/src/lib.rs
+++ b/utf8parse/src/lib.rs
@@ -25,7 +25,7 @@ pub trait Receiver {
/// A parser for Utf8 Characters
///
/// Repeatedly call `advance` with bytes to emit Utf8 characters
-#[derive(Default)]
+#[derive(Clone, Default, PartialEq, Eq, Debug)]
pub struct Parser {
point: u32,
state: State,
diff --git a/utf8parse/src/types.rs b/utf8parse/src/types.rs
index 77a79cc..f57a94d 100644
--- a/utf8parse/src/types.rs
+++ b/utf8parse/src/types.rs
@@ -26,7 +26,7 @@ pub enum Action {
/// There is a state for each initial input of the 3 and 4 byte sequences since
/// the following bytes are subject to different conditions than a tail byte.
#[allow(non_camel_case_types)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum State {
/// Ground state; expect anything
Ground = 0,