Skip to content

Commit 51aaf19

Browse files
authored
Merge pull request #91 from LNP-BP/develop
Strict encoding v0.8.1 fixes
2 parents 7c9267b + 337d293 commit 51aaf19

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commit_verify/src/lnpbp4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl IntoIterator for &MerkleBlock {
574574
}
575575
}
576576

577-
/// commitment under protocol id {0} is absent from the known part of a given
577+
/// commitment under protocol id {_0} is absent from the known part of a given
578578
/// LNPBP-4 Merkle block.
579579
#[derive(
580580
Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Error

strict_encoding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "strict_encoding"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
license = "Apache-2.0"
55
authors = ["Dr. Maxim Orlovsky <[email protected]>"]
66
description = "Strict encoding: deterministic binary serialization for networking & client-side validation"

strict_encoding/derive_helpers/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "encoding_derive_helpers"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
license = "Apache-2.0"
55
authors = ["Dr. Maxim Orlovsky <[email protected]>"]
66
description = "Helper functions for creating different encoding derivation macros"

strict_encoding/derive_helpers/src/encode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ fn encode_enum_impl(
256256
};
257257

258258
inner_impl.append_all(quote_spanned! { variant.span() =>
259+
#[allow(clippy::unnecessary_cast)]
259260
Self::#ident #bra_captures_ket => {
260261
len += (#value as #repr).#encode_name(&mut e)?;
261262
#captures

strict_encoding/src/primitives.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@
1616
1717
use core::time::Duration;
1818
use std::io;
19+
use std::io::{Read, Write};
1920

2021
use amplify::num::u24;
2122

2223
use super::{Error, StrictDecode, StrictEncode};
2324

25+
impl StrictEncode for () {
26+
fn strict_encode<E: Write>(&self, _: E) -> Result<usize, Error> { Ok(0) }
27+
}
28+
29+
impl StrictDecode for () {
30+
fn strict_decode<D: Read>(_: D) -> Result<Self, Error> { Ok(()) }
31+
}
32+
2433
impl StrictEncode for bool {
2534
fn strict_encode<E: io::Write>(&self, mut e: E) -> Result<usize, Error> {
2635
(*self as u8).strict_encode(&mut e)

strict_encoding/test_helpers/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use strict_encoding::{Error, StrictDecode, StrictEncode};
8383
///
8484
/// NB: These errors are specific for testing configuration and should not be
8585
/// used in non-test environment.
86-
#[derive(Clone, PartialEq, Debug, Display, Error)]
86+
#[derive(Clone, PartialEq, Eq, Debug, Display, Error)]
8787
pub enum EnumEncodingTestFailure<T>
8888
where
8989
T: Clone + PartialEq + Debug,
@@ -461,7 +461,7 @@ macro_rules! test_encoding_enum_u8_exhaustive {
461461
///
462462
/// NB: These errors are specific for testing configuration and should not be
463463
/// used in non-test environment.
464-
#[derive(Clone, PartialEq, Debug, Display, Error)]
464+
#[derive(Clone, PartialEq, Eq, Debug, Display, Error)]
465465
pub enum DataEncodingTestFailure<T>
466466
where
467467
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,

0 commit comments

Comments
 (0)