From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/anstyle-parse/src/state/definitions.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'vendor/anstyle-parse/src') diff --git a/vendor/anstyle-parse/src/state/definitions.rs b/vendor/anstyle-parse/src/state/definitions.rs index a1b4c2cc8..c4e767358 100644 --- a/vendor/anstyle-parse/src/state/definitions.rs +++ b/vendor/anstyle-parse/src/state/definitions.rs @@ -2,6 +2,7 @@ use core::mem; #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[repr(u8)] +#[derive(Default)] pub enum State { Anywhere = 0, CsiEntry = 1, @@ -15,19 +16,13 @@ pub enum State { DcsPassthrough = 9, Escape = 10, EscapeIntermediate = 11, + #[default] Ground = 12, OscString = 13, SosPmApcString = 14, Utf8 = 15, } -impl Default for State { - #[inline] - fn default() -> State { - State::Ground - } -} - impl TryFrom for State { type Error = u8; @@ -58,7 +53,9 @@ const STATES: [State; 16] = [ #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u8)] +#[derive(Default)] pub enum Action { + #[default] Nop = 0, Clear = 1, Collect = 2, @@ -77,13 +74,6 @@ pub enum Action { BeginUtf8 = 15, } -impl Default for Action { - #[inline] - fn default() -> Action { - Action::Nop - } -} - impl TryFrom for Action { type Error = u8; -- cgit v1.2.3