Skip to content
This repository was archived by the owner on Jan 10, 2022. It is now read-only.

Changes required to use crate in bitcoin_hashes#4

Closed
dr-orlovsky wants to merge 17 commits intomasterfrom
improvements
Closed

Changes required to use crate in bitcoin_hashes#4
dr-orlovsky wants to merge 17 commits intomasterfrom
improvements

Conversation

@dr-orlovsky
Copy link
Copy Markdown
Member

No description provided.

use hex;
use std::error;

impl error::Error for hex::Error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this allowed? I thought an impl had to be in the same module as either the type or the trait? Is it same crate instead of same module?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hex::Error is defined in this module and you can impl foreign traits for locally-defined types. So yes, this works and compile.

@dr-orlovsky dr-orlovsky force-pushed the improvements branch 4 times, most recently from e6390cb to 7ae7d01 Compare October 11, 2020 00:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants