1
1
use fe2o3_amqp_types:: primitives:: { SimpleValue , Symbol , Binary } ;
2
2
use fe2o3_amqp_types:: messaging:: { Data as AmqpData } ;
3
3
4
+ use crate :: binding:: header_prefix;
4
5
use crate :: message:: StructuredSerializer ;
5
6
use crate :: { message:: { BinarySerializer , MessageAttributeValue , Error } , event:: SpecVersion } ;
6
7
@@ -29,7 +30,7 @@ impl BinarySerializer<AmqpCloudEvent> for AmqpCloudEvent {
29
30
} else {
30
31
// CloudEvent attributes are prefixed with "cloudEvents:" for use in the
31
32
// application-properties section
32
- let key = format ! ( "{}:{}" , ATTRIBUTE_PREFIX , name) ;
33
+ let key = header_prefix ( ATTRIBUTE_PREFIX , name) ;
33
34
let value = SimpleValue :: from ( value) ;
34
35
self . application_properties . insert ( key, value) ;
35
36
}
@@ -44,7 +45,7 @@ impl BinarySerializer<AmqpCloudEvent> for AmqpCloudEvent {
44
45
// how receivers are to interpret messages if the copied values differ from the cloud-event
45
46
// serialized values.
46
47
fn set_extension ( mut self , name : & str , value : MessageAttributeValue ) -> crate :: message:: Result < Self > {
47
- let key = format ! ( "{}:{}" , ATTRIBUTE_PREFIX , name) ;
48
+ let key = header_prefix ( ATTRIBUTE_PREFIX , name) ;
48
49
let value = SimpleValue :: from ( value) ;
49
50
self . application_properties . insert ( key, value) ;
50
51
Ok ( self )
0 commit comments