Skip to content

Commit

Permalink
Improve rustdocs for KeyPair
Browse files Browse the repository at this point in the history
Currently the rustdocs for `KeyPair` are stale in regards to serde, we
_do_ implement `Serialize` and `Deserialize` for `KeyPair`.

Improve the rustdocs for `KeyPair` by removing stale docs and adding
docs on fixed width binary serialization.
  • Loading branch information
tcharding committed Mar 8, 2022
1 parent b1f239e commit 51f744d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,10 @@ impl Ord for PublicKey {
///
/// # Serde support
///
/// [`Serialize`] and [`Deserialize`] are not implemented for this type, even with the `serde`
/// feature active. This is due to security considerations, see the [`serde_keypair`] documentation
/// for details.
///
/// If the `serde` and `global-context` features are active `KeyPair`s can be serialized and
/// deserialized by annotating them with `#[serde(with = "secp256k1::serde_keypair")]`
/// inside structs or enums for which [`Serialize`] and [`Deserialize`] are being derived.
/// Implements de/serialization with the `serde` feature _and_ `global-context` feature enabled.
/// Serializes the secret bytes _only_, this means serialized data is 32 bytes if the `bincode`
/// crate is used for serialization, other binary formats may add metadata to the serialized data
/// (e.g. cbor and tycho).
///
/// # Examples
///
Expand Down

0 comments on commit 51f744d

Please sign in to comment.