Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 57c77b5

Browse files
Use thiserror instead of failure
Failure is deprecated
1 parent 8d1b67a commit 57c77b5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ version = "0.4.0"
1414

1515
[dependencies]
1616
byteorder = "1.3.0"
17-
failure = "0.1.5"
18-
failure_derive = "0.1.5"
17+
thiserror = "1.0.19"
1918
either = "1.5.0"

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::io::{self, ErrorKind, Read};
2020

2121
use byteorder::{ByteOrder, LE};
2222
use either::Either;
23-
use failure_derive::Fail;
23+
use thiserror::Error;
2424

2525
use crate::packet::{
2626
DataTraceAddress, DataTraceDataValue, DataTracePcValue, EventCounter, ExceptionTrace, Function,
@@ -156,17 +156,17 @@ where
156156
}
157157

158158
/// ITM packet decoding errors
159-
#[derive(Debug, Fail)]
159+
#[derive(Debug, Error)]
160160
pub enum Error {
161161
/// The packet starts with a reserved header byte
162-
#[fail(display = "reserved header byte: {}", byte)]
162+
#[error("reserved header byte: {byte}")]
163163
ReservedHeader {
164164
/// The header byte
165165
byte: u8,
166166
},
167167

168168
/// The packet doesn't adhere to the (ARMv7-M) specification
169-
#[fail(display = "malformed packet of length {} with header: {}", len, header)]
169+
#[error("malformed packet of length {len} with header {header}")]
170170
MalformedPacket {
171171
/// The header of the malformed packet
172172
header: u8,

0 commit comments

Comments
 (0)