From b0df0de67035eb60833363ceb4d8607703bd154e Mon Sep 17 00:00:00 2001 From: David Koloski Date: Fri, 16 Jul 2021 21:11:37 -0400 Subject: [PATCH] Disable simdutf8 by default, release 0.6.3 --- bytecheck/Cargo.toml | 9 +++++---- bytecheck/src/lib.rs | 6 ++++-- bytecheck_derive/Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bytecheck/Cargo.toml b/bytecheck/Cargo.toml index fbbf01b..c210088 100644 --- a/bytecheck/Cargo.toml +++ b/bytecheck/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bytecheck" -version = "0.6.2" +version = "0.6.3" authors = ["David Koloski "] edition = "2018" description = "Derive macro for bytecheck" @@ -14,9 +14,9 @@ readme = "crates-io.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bytecheck_derive = { version = "=0.6.2", path = "../bytecheck_derive", default-features = false } +bytecheck_derive = { version = "=0.6.3", path = "../bytecheck_derive", default-features = false } ptr_meta = "0.1" -simdutf8 = { version = "0.1", default-features = false } +simdutf8 = { version = "0.1", default-features = false, optional = true } # Support for various common crates. These are primarily to get users off the ground and build some # momentum. @@ -30,4 +30,5 @@ uuid = { version = "0.8", optional = true } [features] default = ["std"] verbose = [] -std = ["bytecheck_derive/std", "simdutf8/std"] +simdutf8_std = ["simdutf8/std"] +std = ["bytecheck_derive/std"] diff --git a/bytecheck/src/lib.rs b/bytecheck/src/lib.rs index 6594831..3418217 100644 --- a/bytecheck/src/lib.rs +++ b/bytecheck/src/lib.rs @@ -137,9 +137,11 @@ use core::{ ops, ptr, slice, }; use ptr_meta::PtrExt; -#[cfg(not(feature = "verbose"))] +#[cfg(not(feature = "simdutf8"))] +use core::str::{from_utf8, Utf8Error}; +#[cfg(all(feature = "simdutf8", not(feature = "verbose")))] use simdutf8::basic::{from_utf8, Utf8Error}; -#[cfg(feature = "verbose")] +#[cfg(all(feature = "simdutf8", feature = "verbose"))] use simdutf8::compat::{from_utf8, Utf8Error}; pub use bytecheck_derive::CheckBytes; diff --git a/bytecheck_derive/Cargo.toml b/bytecheck_derive/Cargo.toml index 7c6d094..9f29197 100644 --- a/bytecheck_derive/Cargo.toml +++ b/bytecheck_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bytecheck_derive" -version = "0.6.2" +version = "0.6.3" authors = ["David Koloski "] edition = "2018" description = "Derive macro for bytecheck"