Skip to content

Commit

Permalink
Use modern crates anyhow and thiserror instead of failure (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavser authored Jun 19, 2024
1 parent 661ca2f commit fbfaad1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.

##
## Version 1.1.0

- Use modern crates anyhow and thiserror instead of failure

## Version 1.0.31

- Supported merge of block and types repos
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ license = 'Apache-2.0'
name = 'ever-struct'
repository = 'https://github.com/everx-labs/ever-struct'
rust-version = '1.65'
version = '1.0.36'
version = '1.1.0'

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

6 changes: 3 additions & 3 deletions src/scheme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use ever_block::{
fail, BuilderData, Cell, Deserializable, IBitstring, Result, Serializable, SliceData,
};

#[derive(Debug, failure::Fail)]
#[derive(Debug, thiserror::Error)]
pub enum DeserializationError {
#[fail(display = "unexpected tlb tag")]
#[error("unexpected tlb tag")]
UnexpectedTLBTag,
}

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

if slice.get_next_bit()? {
Expand Down

0 comments on commit fbfaad1

Please sign in to comment.