File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -973,33 +973,35 @@ pub enum InsertDescriptorError<K> {
973973 } ,
974974}
975975
976- impl < K : core:: fmt:: Debug > core:: fmt:: Display for InsertDescriptorError < K > {
976+ impl < K : core:: fmt:: Display > core:: fmt:: Display for InsertDescriptorError < K > {
977977 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
978978 match self {
979979 InsertDescriptorError :: DescriptorAlreadyAssigned {
980- existing_assignment : existing ,
980+ existing_assignment,
981981 descriptor,
982982 } => {
983983 write ! (
984984 f,
985- "attempt to re-assign descriptor {descriptor:?} already assigned to {existing:?}"
985+ "descriptor '{}' is already in use by another keychain '{}'" ,
986+ descriptor, existing_assignment
986987 )
987988 }
988989 InsertDescriptorError :: KeychainAlreadyAssigned {
989- existing_assignment : existing ,
990+ existing_assignment,
990991 keychain,
991992 } => {
992993 write ! (
993994 f,
994- "attempt to re-assign keychain {keychain:?} already assigned to {existing:?}"
995+ "keychain '{}' is already associated with another descriptor '{}'" ,
996+ keychain, existing_assignment
995997 )
996998 }
997999 }
9981000 }
9991001}
10001002
10011003#[ cfg( feature = "std" ) ]
1002- impl < K : core:: fmt:: Debug > std:: error:: Error for InsertDescriptorError < K > { }
1004+ impl < K : core:: fmt:: Display + core :: fmt :: Debug > std:: error:: Error for InsertDescriptorError < K > { }
10031005
10041006/// `ChangeSet` represents persistent updates to a [`KeychainTxOutIndex`].
10051007///
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ enum TestKeychain {
1818 Internal ,
1919}
2020
21+ impl core:: fmt:: Display for TestKeychain {
22+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
23+ match self {
24+ TestKeychain :: External => write ! ( f, "External" ) ,
25+ TestKeychain :: Internal => write ! ( f, "Internal" ) ,
26+ }
27+ }
28+ }
29+
2130fn parse_descriptor ( descriptor : & str ) -> Descriptor < DescriptorPublicKey > {
2231 let secp = bdk_chain:: bitcoin:: secp256k1:: Secp256k1 :: signing_only ( ) ;
2332 Descriptor :: < DescriptorPublicKey > :: parse_descriptor ( & secp, descriptor)
You can’t perform that action at this time.
0 commit comments