Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate from failure to anyhow + thiserror #127

Merged
merged 7 commits into from
Feb 24, 2021

Conversation

drunkirishcoder
Copy link
Contributor

Description

Fixes RUSTSEC-2020-0036.

There are a few options but seems like anyhow is the most active and it's a pretty easy drop in replacement for error propagation. The derive macro is replaced with thiserror. Together that covers all the ways we were using failure crate.

Type of change

maintenance chore

@codecov
Copy link

codecov bot commented Feb 21, 2021

Codecov Report

Merging #127 (c325796) into master (34a1694) will decrease coverage by 0.02%.
The diff coverage is 63.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
- Coverage   68.60%   68.57%   -0.03%     
==========================================
  Files          65       65              
  Lines        5902     5906       +4     
==========================================
+ Hits         4049     4050       +1     
- Misses       1853     1856       +3     
Impacted Files Coverage Δ
core/src/batch/filter_map.rs 66.66% <ø> (ø)
core/src/batch/for_each.rs 62.50% <ø> (ø)
core/src/batch/map.rs 75.00% <ø> (ø)
core/src/batch/mod.rs 97.81% <ø> (ø)
core/src/batch/replace.rs 76.92% <ø> (ø)
core/src/config.rs 46.61% <0.00%> (ø)
core/src/dpdk/kni.rs 0.00% <0.00%> (ø)
core/src/dpdk/port.rs 0.00% <0.00%> (ø)
core/src/dpdk/stats.rs 0.00% <0.00%> (ø)
core/src/net/mac.rs 86.48% <ø> (ø)
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34a1694...b830d52. Read the comment docs.

Copy link
Member

@zeeshanlakhani zeeshanlakhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a pretty minor comment on #80 that would change this, but this is super straightforward. Having using anyhow in another project, this totally is what I/we expected and doesn't mean a ton of changes.

@zeeshanlakhani
Copy link
Member

I do ❤️ ocd @drunkirishcoder

Copy link
Member

@zeeshanlakhani zeeshanlakhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazingly thorough. I also agree w/ not needing the type packet processing/parsing error types, and just using the anyhow! macro.

display = "Struct size {} exceeds the remaining buffer length {}.",
_0, _1
)]
#[error("Struct size {0} exceeds the remaining buffer length {1}.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nicer.

@drunkirishcoder drunkirishcoder merged commit e4f542b into master Feb 24, 2021
@drunkirishcoder drunkirishcoder deleted the djin/anyhow-anywho branch February 24, 2021 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants