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

Commit

Permalink
Merge #32
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors[bot] and jonas-schievink authored Jun 6, 2020
2 parents 78bb4b6 + bec338e commit 5dd476d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
- env: TARGET=x86_64-unknown-linux-gnu
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
# MSRV
rust: 1.38.0
rust: 1.31.0

before_install:
- set -e
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ version = "0.4.0"

[dependencies]
byteorder = "1.3.0"
failure = "0.1.5"
failure_derive = "0.1.5"
thiserror = "1.0.19"
either = "1.5.0"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ itmdump --version

## Minimum Supported Rust Version (MSRV)

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

## License
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::io::{self, ErrorKind, Read};

use byteorder::{ByteOrder, LE};
use either::Either;
use failure_derive::Fail;
use thiserror::Error;

use crate::packet::{
DataTraceAddress, DataTraceDataValue, DataTracePcValue, EventCounter, ExceptionTrace, Function,
Expand Down Expand Up @@ -156,17 +156,17 @@ where
}

/// ITM packet decoding errors
#[derive(Debug, Fail)]
#[derive(Debug, Error)]
pub enum Error {
/// The packet starts with a reserved header byte
#[fail(display = "reserved header byte: {}", byte)]
#[error("reserved header byte: {byte}")]
ReservedHeader {
/// The header byte
byte: u8,
},

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

0 comments on commit 5dd476d

Please sign in to comment.