Error return type of TryFrom<Vec<u8>> for PrivateKeyDer<'_> doesn't impl std::error::Error
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cryptography
Research direction
Search for the TryFrom<Vec> implementation for PrivateKeyDer<'_> and inspect its current error return type. Update the conversion so its error implements core::error::Error, then verify that the anyhow example in the issue can use ? without a conversion error.
Written by the indexing model from the issue text.
Description
I tried the following:
let key = PrivateKeyDer::try_from(std::fs::read(key)?)?;
And I get the error:
?couldn't convert the error:str: std::error::Erroris not satisfied
the question mark operation (?) implicitly performs a conversion on the error value using theFromtrait
required for&strto implementstd::error::Error
required foranyhow::Errorto implementFrom<&str>
Unfortunately &str doesn't impl core::error::Error, so using it as the error return type in a try_from can cause users of the library some difficulty. It would be better to instead return a type that impls core::error::Error in the error value.
- Dominant language
- Rust
- Stars
- 42
- Forks
- 55
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rustls/pki-types
-
Difficulty 4/5 1-2 days Newbie friendliness 55/100
-
next-major-release
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
next-major-release
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
next-major-release
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
next-major-release
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in rustls/pki-types
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pop-os/cosmic-settings#2296 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Eyevinn/open-live-ingest#36 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
superradcompany/microsandbox#2071 ·
Maintainers usually reply within 1 day
-
app
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug bug jury peripheral:i2s
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
esp-rs/esp-hal#6828 · 1 comment ·
Maintainers usually reply within 1 day