Skip to content

Commit

Permalink
ref: Remove deprecated error-chain and failure crates (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Nov 16, 2020
1 parent 1831525 commit 13ed3d5
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 635 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Expand Up @@ -24,8 +24,6 @@ jobs:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
with:
key: lints

- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -64,8 +62,6 @@ jobs:
override: true

- uses: Swatinem/rust-cache@v1
with:
key: check

- run: make checkall

Expand All @@ -91,8 +87,6 @@ jobs:
override: true

- uses: Swatinem/rust-cache@v1
with:
key: test

- name: Run cargo test
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -125,8 +119,6 @@ jobs:
override: true

- uses: Swatinem/rust-cache@v1
with:
key: fast-MSRV

- run: make checkfast

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Breaking Changes**:

- The deprecated `error-chain` and `failure` integrations, features and crates were removed.

## 0.21.0

**Breaking Changes**:
Expand Down
2 changes: 0 additions & 2 deletions Cargo.toml
Expand Up @@ -7,8 +7,6 @@ members = [
"sentry-contexts",
"sentry-core",
"sentry-debug-images",
"sentry-error-chain",
"sentry-failure",
"sentry-log",
"sentry-panic",
"sentry-slog",
Expand Down
12 changes: 1 addition & 11 deletions Makefile
Expand Up @@ -53,7 +53,7 @@ testall:
checkfast: check-no-default-features check-default-features
.PHONY: checkfast

checkall: check-all-features check-no-default-features check-default-features check-failure check-panic check-all-impls check-curl-transport check-actix
checkall: check-all-features check-no-default-features check-default-features check-panic check-curl-transport check-actix
.PHONY: checkall

check-all-features:
Expand All @@ -71,21 +71,11 @@ check-no-default-features:
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features
.PHONY: check-no-default-features

check-failure:
@echo 'NO CLIENT + FAILURE'
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure'
.PHONY: check-failure

check-panic:
@echo 'NO CLIENT + PANIC'
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'panic'
.PHONY: check-panic

check-all-impls:
@echo 'NO CLIENT + ALL IMPLS'
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure,panic'
.PHONY: check-all-impls

check-curl-transport:
@echo 'CURL TRANSPORT'
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --features curl
Expand Down
39 changes: 0 additions & 39 deletions sentry-backtrace/src/trim.rs
Expand Up @@ -26,11 +26,6 @@ lazy_static::lazy_static! {
"anyhow::",
"<sentry_log::Logger as log::Log>::log",
];

// TODO: remove all of this together with the deprecated `error_chain` support
static ref SECONDARY_BORDER_FRAMES: Vec<(&'static str, &'static str)> = vec![
("error_chain::make_backtrace", "<T as core::convert::Into<U>>::into")
];
}

/// A helper function to trim a stacktrace.
Expand All @@ -48,42 +43,8 @@ where
});

if let Some(cutoff) = known_cutoff {
let secondary = {
let func = stacktrace.frames[stacktrace.frames.len() - cutoff - 1]
.function
.as_ref()
.unwrap();

SECONDARY_BORDER_FRAMES
.iter()
.filter_map(|&(primary, secondary)| {
if function_starts_with(func, primary) {
Some(secondary)
} else {
None
}
})
.next()
};
let trunc = stacktrace.frames.len() - cutoff - 1;
stacktrace.frames.truncate(trunc);

if let Some(secondary) = secondary {
let secondary_cutoff =
stacktrace
.frames
.iter()
.rev()
.position(|frame| match frame.function {
Some(ref func) => function_starts_with(&func, secondary),
None => false,
});

if let Some(cutoff) = secondary_cutoff {
let trunc = stacktrace.frames.len() - cutoff - 1;
stacktrace.frames.truncate(trunc);
}
}
}
}

Expand Down
23 changes: 0 additions & 23 deletions sentry-error-chain/Cargo.toml

This file was deleted.

34 changes: 0 additions & 34 deletions sentry-error-chain/README.md

This file was deleted.

132 changes: 0 additions & 132 deletions sentry-error-chain/src/lib.rs

This file was deleted.

24 changes: 0 additions & 24 deletions sentry-failure/Cargo.toml

This file was deleted.

36 changes: 0 additions & 36 deletions sentry-failure/README.md

This file was deleted.

0 comments on commit 13ed3d5

Please sign in to comment.