diff --git a/Cargo.lock b/Cargo.lock index d96d9ba5..b005f06b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "hex-literal" -version = "0.3.0" +version = "0.3.1" [[package]] name = "opaque-debug" diff --git a/hex-literal/CHANGELOG.md b/hex-literal/CHANGELOG.md index 537e3c19..a590ed5e 100644 --- a/hex-literal/CHANGELOG.md +++ b/hex-literal/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.3.1 (2020-08-01) +### Added +- Documentation for the `hex!` macro ([#73]) + +[#73]: https://github.com/RustCrypto/utils/pull/73 + ## 0.3.0 (2020-07-16) ### Changed - MSRV bump to 1.45 ([#53]) diff --git a/hex-literal/Cargo.toml b/hex-literal/Cargo.toml index 7490b784..f991cb0a 100644 --- a/hex-literal/Cargo.toml +++ b/hex-literal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hex-literal" -version = "0.3.0" +version = "0.3.1" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" description = "Procedural macro for converting hexadecimal string to byte array at compile time." diff --git a/hex-literal/src/lib.rs b/hex-literal/src/lib.rs index 52de8ba2..68b6d5cd 100644 --- a/hex-literal/src/lib.rs +++ b/hex-literal/src/lib.rs @@ -90,7 +90,7 @@ impl TokenTreeIter { b'A'..=b'F' => v - 55, b'a'..=b'f' => v - 87, b' ' | b'\r' | b'\n' | b'\t' => continue, - _ => panic!("invalid character"), + _ => panic!("encountered invalid character"), }; return Some(n); } @@ -117,6 +117,8 @@ impl Iterator for TokenTreeIter { } } +/// Macro for converting string literal containing hex-encoded string +/// to an array containing decoded bytes #[proc_macro] pub fn hex(input: TokenStream) -> TokenStream { let ts = TokenStream::from_iter(TokenTreeIter::new(input));