Skip to content

Commit

Permalink
Target panic message at lib users
Browse files Browse the repository at this point in the history
Currently the panic message refers to stuff related to development of
the library, this is meaningless for users of the lib. Target panic
message at secp users instead.
  • Loading branch information
tcharding committed Aug 9, 2023
1 parent 8a5e165 commit 6248570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ impl<'de> serde::Deserialize<'de> for KeyPair {
let ctx = Secp256k1::signing_only();

#[cfg(not(any(feature = "global-context", feature = "alloc")))]
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("cannot deserialize key pair without a context (please enable either the global-context or alloc feature)");

#[allow(clippy::needless_borrow)]
KeyPair::from_seckey_slice(&ctx, data)
Expand Down

0 comments on commit 6248570

Please sign in to comment.