Error return type of TryFrom<Vec<u8>> for PrivateKeyDer<'_> doesn't impl std::error::Error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 39
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
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.
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.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100