summaryrefslogtreecommitdiffstats
path: root/crates/core/c8y_smartrest/src/smartrest_serializer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/c8y_smartrest/src/smartrest_serializer.rs')
-rw-r--r--crates/core/c8y_smartrest/src/smartrest_serializer.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/core/c8y_smartrest/src/smartrest_serializer.rs b/crates/core/c8y_smartrest/src/smartrest_serializer.rs
index 503a345b..4581a2cf 100644
--- a/crates/core/c8y_smartrest/src/smartrest_serializer.rs
+++ b/crates/core/c8y_smartrest/src/smartrest_serializer.rs
@@ -201,11 +201,13 @@ where
}
fn serialize_smartrest<S: Serialize>(record: S) -> Result<String, SmartRestSerializerError> {
- let mut wtr = WriterBuilder::new()
- .has_headers(false)
- .quote_style(QuoteStyle::Never)
- .double_quote(false)
- .from_writer(vec![]);
+ let mut wtr = Box::new(
+ WriterBuilder::new()
+ .has_headers(false)
+ .quote_style(QuoteStyle::Never)
+ .double_quote(false)
+ .from_writer(vec![]),
+ );
wtr.serialize(record)?;
let csv = String::from_utf8(wtr.into_inner()?)?;
Ok(csv)