1#![deny(clippy::all, missing_docs, unused_crate_dependencies)]
2#![allow(clippy::items_after_test_module, clippy::tabs_in_doc_comments)]
3#![no_std]
4
5extern crate alloc;
11
12mod hex;
13pub use hex::*;
14
15mod op;
16pub use op::*;
17
18#[cfg(feature = "serde")] mod serde;
19#[cfg(feature = "serde")] pub use serde::*;
20
21mod prelude {
22 pub use alloc::{string::String, vec::Vec};
23
24 pub use smallvec::SmallVec;
25
26 pub use crate::{Error, Result};
27
28 pub(crate) use crate::op;
29
30 #[cfg(test)]
31 mod test {
32 use const_hex as _;
34 use criterion as _;
35 use faster_hex as _;
36 use hex_crate as _;
37 use rustc_hex as _;
38 use serde as _;
39 use serde_json as _;
40
41 use super::*;
43
44 #[derive(Debug, PartialEq)]
45 pub struct Ljf(pub Vec<u8>);
46 impl From<Vec<u8>> for Ljf {
47 fn from(bytes: Vec<u8>) -> Self {
48 Self(bytes)
49 }
50 }
51
52 #[derive(Debug, PartialEq)]
53 pub struct Ljfn(pub [u8; 17]);
54 impl From<[u8; 17]> for Ljfn {
55 fn from(array: [u8; 17]) -> Self {
56 Self(array)
57 }
58 }
59 }
60 #[cfg(test)] pub use test::*;
61}
62
63#[cfg(feature = "serde")] pub use serde_bytes;
64
65#[allow(missing_docs)]
66pub type Result<T, E = Error> = core::result::Result<T, E>;
67
68#[allow(missing_docs)]
69#[derive(Debug, PartialEq, Eq)]
70pub enum Error {
71 InvalidLength,
73 InvalidCharacter {
75 character: char,
77 index: usize,
79 },
80 MismatchedLength {
82 expect: usize,
84 },
85 Utf8Error(core::str::Utf8Error),
87 ParseIntError(core::num::ParseIntError),
89}