Merge rust-bitcoin/rust-bitcoin#4561: Do not derive `Default` on `CompactTarget`

e47836fb1e Do not derive Default on CompactTarget (Tobin C. Harding)

Pull request description:

  It is not immediately obvious what a zero value compact target is. Because of this and the fact that we are trying to release minimal code in `primitives 1.0` its best to remove the `Default` derive.

  This is an API breaking change.

ACKs for top commit:
  apoelstra:
    ACK e47836fb1e0c96936096efb2dfca4e2cbc9b9e5f; successfully ran local tests

Tree-SHA512: 7edb067a7ed66af8155b86b2391ee839b0a21b3d8d36b555123b14e93f1822b89c080328464b194e4ff47643440c56fa5afee929fe58b52d5f1cf84c9b96ca83
This commit is contained in:
merge-script 2025-05-30 18:29:43 +00:00
commit b8c356613b
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ use core::fmt;
/// `CompactTarget` and `Target` is lossy *in both directions* (there are multiple `CompactTarget` /// `CompactTarget` and `Target` is lossy *in both directions* (there are multiple `CompactTarget`
/// values that map to the same `Target` value). Ordering and equality for this type are defined in /// values that map to the same `Target` value). Ordering and equality for this type are defined in
/// terms of the underlying `u32`. /// terms of the underlying `u32`.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CompactTarget(u32); pub struct CompactTarget(u32);