Skip to content

Commit

Permalink
Release v7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Dec 7, 2024
1 parent 8f78e7b commit bd88819
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 104 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v7.1.0
- Rename `se_hex` to `ser_hex`.
- Rename `se_hex_without_prefix` to `ser_hex_without_prefix`.

## v7.0.0
- Improve docs.
- Improve tests.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ license = "Apache-2.0/GPL-3.0"
name = "array-bytes"
readme = "README.md"
repository = "https://github.com/hack-ink/array-bytes"
version = "7.0.0"
version = "7.1.0"

[profile.ci-dev]
incremental = false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
- `#[serde(deserialize_with = "array_bytes::de_try_from_hex")]`
- type `S -> impl TryFromHex`
- e.g. `"0xA" -> 10_u32`
- `#[serde(serialize_with = "array_bytes::se_hex")]`
- `#[serde(serialize_with = "array_bytes::ser_hex/array_bytes::ser_hex_without_prefix")]`
- type `S -> impl Hex`
- e.g. `"0x00" -> vec![0_u8]`

Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,13 @@ where
///
/// #[derive(Debug, PartialEq, Serialize)]
/// struct Ljf {
/// #[serde(serialize_with = "array_bytes::se_hex")]
/// #[serde(serialize_with = "array_bytes::ser_hex")]
/// _0: u8,
/// #[serde(serialize_with = "array_bytes::se_hex")]
/// #[serde(serialize_with = "array_bytes::ser_hex")]
/// _1: u16,
/// #[serde(serialize_with = "array_bytes::se_hex")]
/// #[serde(serialize_with = "array_bytes::ser_hex")]
/// _2: u32,
/// #[serde(serialize_with = "array_bytes::se_hex")]
/// #[serde(serialize_with = "array_bytes::ser_hex")]
/// _3: [u8; 4],
/// }
///
Expand All @@ -1066,28 +1066,28 @@ where
/// );
/// ```
#[cfg(feature = "serde")]
pub fn se_hex<S, T>(hex: T, serializer: S) -> Result<S::Ok, S::Error>
pub fn ser_hex<S, T>(hex: T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: Hex,
{
serializer.serialize_str(&hex.hex("0x"))
}
/// Just like [`se_hex`] but without the prefix.
/// Just like [`ser_hex`] but without the prefix.
///
/// # Examples
/// ```
/// use serde::Serialize;
///
/// #[derive(Debug, PartialEq, Serialize)]
/// struct Ljf {
/// #[serde(serialize_with = "array_bytes::se_hex_without_prefix")]
/// #[serde(serialize_with = "array_bytes::ser_hex_without_prefix")]
/// _0: u8,
/// #[serde(serialize_with = "array_bytes::se_hex_without_prefix")]
/// #[serde(serialize_with = "array_bytes::ser_hex_without_prefix")]
/// _1: u16,
/// #[serde(serialize_with = "array_bytes::se_hex_without_prefix")]
/// #[serde(serialize_with = "array_bytes::ser_hex_without_prefix")]
/// _2: u32,
/// #[serde(serialize_with = "array_bytes::se_hex_without_prefix")]
/// #[serde(serialize_with = "array_bytes::ser_hex_without_prefix")]
/// _3: [u8; 4],
/// }
///
Expand All @@ -1097,7 +1097,7 @@ where
/// );
/// ```
#[cfg(feature = "serde")]
pub fn se_hex_without_prefix<S, T>(hex: T, serializer: S) -> Result<S::Ok, S::Error>
pub fn ser_hex_without_prefix<S, T>(hex: T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: Hex,
Expand Down
Loading

0 comments on commit bd88819

Please sign in to comment.