From ea940fcb74abce67b927788e4f9f64fc63073d37 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 23 Nov 2019 02:01:09 +0100 Subject: Update to Rust 2018 This moves all crates in the workspace to the latest Rust standard and resolves various style and formatting issues. Fixes #32. --- utf8parse/src/types.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utf8parse/src/types.rs') diff --git a/utf8parse/src/types.rs b/utf8parse/src/types.rs index a5b9436..93607fb 100644 --- a/utf8parse/src/types.rs +++ b/utf8parse/src/types.rs @@ -27,6 +27,12 @@ pub enum State { Utf8_4_3_f4 = 7, } +impl Default for State { + fn default() -> State { + State::Ground + } +} + /// Action to take when receiving a byte #[allow(dead_code)] #[derive(Debug, Copy, Clone)] @@ -70,7 +76,6 @@ pub unsafe fn unpack(val: u8) -> (State, Action) { ( // State is stored in bottom 4 bits mem::transmute(val & 0x0f), - // Action is stored in top 4 bits mem::transmute(val >> 4), ) -- cgit