jmcnamara / rust_xlsxwriter

A Rust library for creating Excel XLSX files.
https://crates.io/crates/rust_xlsxwriter
Apache License 2.0
250 stars 23 forks source link

fix!: detach format lifetime from worksheet #86

Closed dodomorandi closed 5 months ago

dodomorandi commented 5 months ago

Issue: #85

At the moment the lifetime of Format inside IntoExcelData::write_to_format is bound to the lifetime of the worksheet. However, this is not actually required anywhere in the code, and with this constraint it is not possible to create abstractions with an internal formatter because, once the ownership of the data is taken by write_with_format, the stored format cannot outlive the call.

This breaking change should simplify the management of formatters.

jmcnamara commented 5 months ago

Ignore the clippy fail. It is due to a newer version of clippy with updated rules. I'll fix that.

jmcnamara commented 5 months ago

Merged. Thanks.