fschutt / printpdf

A fully-featured PDF library for Rust, WASM-ready
https://fschutt.github.io/printpdf/
MIT License
829 stars 98 forks source link

Wasm build fails due to multiple moves (js_sys::Date does not copy) #135

Closed ba-sap closed 1 year ago

ba-sap commented 1 year ago

cargo build --target wasm32-unknown-unknown

error[E0382]: use of moved value: current_time --> src\pdf_metadata.rs:62:32 | 58 | let current_time = OffsetDateTime::now_utc(); | ------------ move occurs because current_time has type js_sys_date::OffsetDateTime, which does not implement the Copy trait ... 61 | creation_date: current_time, | ------------ value moved here 62 | modification_date: current_time, | ^^^^^^^^^^^^ value used here after move

error[E0382]: use of moved value: current_time --> src\pdf_metadata.rs:63:28 | 58 | let current_time = OffsetDateTime::now_utc(); | ------------ move occurs because current_time has type js_sys_date::OffsetDateTime, which does not implement the Copy trait ... 62 | modification_date: current_time, | ------------ value moved here 63 | metadata_date: current_time, | ^^^^^^^^^^^^ value used here after move

fschutt commented 1 year ago

thanks @ba-sap