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

Commit 5dd476d

Browse files
Merge #32
32: Use thiserror instead of failure r=adamgreig a=jonas-schievink Failure is deprecated and by default pulls in a lot of dependencies, including ELF parsers. As a side effect, we can now build on Rust 1.31.0 and up. r? @adamgreig Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 parents 78bb4b6 + bec338e commit 5dd476d

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
- env: TARGET=x86_64-unknown-linux-gnu
66
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
77
# MSRV
8-
rust: 1.38.0
8+
rust: 1.31.0
99

1010
before_install:
1111
- set -e

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"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ itmdump --version
2323

2424
## Minimum Supported Rust Version (MSRV)
2525

26-
This crate is guaranteed to compile on stable Rust 1.38.0 and up. It *might*
26+
This crate is guaranteed to compile on stable Rust 1.31.0 and up. It *might*
2727
compile with older versions but that may change in any new patch release.
2828

2929
## License

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)