Skip to content

Conversation

thomaseizinger
Copy link

First patch is a minor cleanup.
Second patch adds the functionality claimed in the title.

Instead of importing `Debug` directly and fully-qualifying fmt via
`::core::fmt` in other places, we bring the whole `core::fmt` module
into scope and refer to `Formatter` and `Result` as `fmt::Formatter`
and `fmt::Result`.
Although not strictly required by trait-bounds, we introduce a
dedicated error type in case the conversion fails. If the `std`
feature is enabled, this error type implements `std::error::Error`.

Having a dedicated error type improves ergonomics a lot as many
uses of `TryFrom` imply `TryFrom::Error: std::error::Error`.

We don't alter the original APIs of `Scalar` and `EdwardsPoint` to
maintain backwards compatible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant