Skip to content

Commit 8ea7cdc

Browse files
committed
replace format with header_prefix
Signed-off-by: minghuaw <[email protected]>
1 parent 2399f54 commit 8ea7cdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/binding/fe2o3_amqp/serializer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use fe2o3_amqp_types::primitives::{SimpleValue, Symbol, Binary};
22
use fe2o3_amqp_types::messaging::{Data as AmqpData};
33

4+
use crate::binding::header_prefix;
45
use crate::message::StructuredSerializer;
56
use crate::{message::{BinarySerializer, MessageAttributeValue, Error}, event::SpecVersion};
67

@@ -29,7 +30,7 @@ impl BinarySerializer<AmqpCloudEvent> for AmqpCloudEvent {
2930
} else {
3031
// CloudEvent attributes are prefixed with "cloudEvents:" for use in the
3132
// application-properties section
32-
let key = format!("{}:{}", ATTRIBUTE_PREFIX, name);
33+
let key = header_prefix(ATTRIBUTE_PREFIX, name);
3334
let value = SimpleValue::from(value);
3435
self.application_properties.insert(key, value);
3536
}
@@ -44,7 +45,7 @@ impl BinarySerializer<AmqpCloudEvent> for AmqpCloudEvent {
4445
// how receivers are to interpret messages if the copied values differ from the cloud-event
4546
// serialized values.
4647
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);
4849
let value = SimpleValue::from(value);
4950
self.application_properties.insert(key, value);
5051
Ok(self)

0 commit comments

Comments
 (0)