diff --git a/src/sink.rs b/src/sink.rs index 92e56af..a01c675 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -311,11 +311,9 @@ where let partition_key = if self.get_config().print_key { let key = record_result.partition_key.to_string(); - let key = self.write_key(&key); - - format!("{} ", key) + Metadata::content(self.write_key(&key)) } else { - "".to_string() + Metadata::Empty }; let sequence_number = if self.get_config().print_sequence_number { diff --git a/src/sink/console_tests.rs b/src/sink/console_tests.rs index b9cf38b..2f51bd6 100644 --- a/src/sink/console_tests.rs +++ b/src/sink/console_tests.rs @@ -123,8 +123,7 @@ fn format_outputs_raw() { }; let vec = console.format_record(&record); - let result = String::from_utf8_lossy(vec.as_slice()); - assert_eq!(result, "Hello �World\n"); + assert_eq!(vec, b"Hello \xF0\x90\x80World\n"); } #[tokio::test]