Skip to content

Commit fbfaad1

Browse files
authored
Use modern crates anyhow and thiserror instead of failure (#52)
1 parent 661ca2f commit fbfaad1

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to this project will be documented in this file.
44

55
##
6+
## Version 1.1.0
7+
8+
- Use modern crates anyhow and thiserror instead of failure
9+
610
## Version 1.0.31
711

812
- Supported merge of block and types repos

Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ license = 'Apache-2.0'
55
name = 'ever-struct'
66
repository = 'https://github.com/everx-labs/ever-struct'
77
rust-version = '1.65'
8-
version = '1.0.36'
8+
version = '1.1.0'
99

1010
[dependencies]
11-
anyhow = '1.0.70'
12-
failure = '0.1.0'
13-
hex-literal = '0.3.4'
11+
anyhow = '1.0'
12+
thiserror = '1.0'
1413
ever_block = { git = 'https://github.com/everx-labs/ever-block.git', tag = '1.10.4' }
15-

src/scheme/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use ever_block::{
1818
fail, BuilderData, Cell, Deserializable, IBitstring, Result, Serializable, SliceData,
1919
};
2020

21-
#[derive(Debug, failure::Fail)]
21+
#[derive(Debug, thiserror::Error)]
2222
pub enum DeserializationError {
23-
#[fail(display = "unexpected tlb tag")]
23+
#[error("unexpected tlb tag")]
2424
UnexpectedTLBTag,
2525
}
2626

@@ -124,7 +124,7 @@ impl Deserializable for TVC {
124124
fn read_from(&mut self, slice: &mut SliceData) -> Result<()> {
125125
let tag = slice.get_next_u32()?;
126126
if tag != Self::TVC_TAG {
127-
return Err(DeserializationError::UnexpectedTLBTag.into());
127+
fail!(DeserializationError::UnexpectedTLBTag);
128128
}
129129

130130
if slice.get_next_bit()? {

0 commit comments

Comments
 (0)