devela/code/util/
_use.rs
1macro_rules! _use {
14 (compat::from_utf8) => {
17 #[allow(unused_imports)]
18 #[cfg(not(feature = "dep_simdutf8"))]
19 use ::core::str::{from_utf8, from_utf8_mut};
20 #[allow(unused_imports)]
21 #[cfg(feature = "dep_simdutf8")]
22 use ::simdutf8::compat::{from_utf8, from_utf8_mut};
23 };
24 (basic::from_utf8) => {
25 #[allow(unused_imports)]
26 #[cfg(not(feature = "dep_simdutf8"))]
27 use ::core::str::{from_utf8, from_utf8_mut};
28 #[allow(unused_imports)]
29 #[cfg(feature = "dep_simdutf8")]
30 use ::simdutf8::basic::{from_utf8, from_utf8_mut};
31 };
32 (both::from_utf8) => {
33 #[allow(unused_imports)]
34 #[cfg(not(feature = "dep_simdutf8"))]
35 use ::core::str::{from_utf8 as basic_from_utf8, from_utf8_mut as basic_from_utf8_mut};
36 #[allow(unused_imports)]
37 #[cfg(feature = "dep_simdutf8")]
38 use ::simdutf8::basic::{
39 from_utf8 as basic_from_utf8, from_utf8_mut as basic_from_utf8_mut,
40 };
41
42 #[allow(unused_imports)]
43 #[cfg(not(feature = "dep_simdutf8"))]
44 use ::core::str::{from_utf8 as compat_from_utf8, from_utf8_mut as compat_from_utf8_mut};
45 #[allow(unused_imports)]
46 #[cfg(feature = "dep_simdutf8")]
47 use ::simdutf8::compat::{
48 from_utf8 as compat_from_utf8, from_utf8_mut as compat_from_utf8_mut,
49 };
50 };
51
52 (@basic::from_utf8($v:expr)) => {{
54 #[cfg(not(feature = "dep_simdutf8"))]
55 {
56 ::core::str::from_utf8(v)
57 }
58 #[cfg(feature = "dep_simdutf8")]
59 {
60 ::simdutf8::basic::from_utf8(v)
61 }
62 }};
63}
64pub(crate) use _use;