I'm trying to compile the sample code from the docx crate:
# Cargo.toml
[dependencies]
docx = "1.1.2"
//! main.rs
use docx::document::Paragraph;
use docx::DocxFile;
fn main() {
let docx = DocxFile::from_file("origin.docx").unwrap();
let mut docx = docx.parse().unwrap();
let para = Paragraph::default().push_text("Lorem Ipsum");
docx.document.push(para);
docx.write_file("origin_appended.docx").unwrap();
}
This is the full error I'm getting:
Compiling bzip2-sys v0.1.11+1.0.8
Compiling jetscii v0.4.4
Compiling quote v1.0.21
Compiling time v0.1.44
error: generic parameters may not be used in const operations
--> /home/thwart/.cargo/registry/src/github.com-1ecc6299db9ec823/jetscii-0.4.4/src/simd.rs:109:13
|
109 | T::CONTROL_BYTE,
| ^^^^^^^^^^^^^^^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
error: generic parameters may not be used in const operations
--> /home/thwart/.cargo/registry/src/github.com-1ecc6299db9ec823/jetscii-0.4.4/src/simd.rs:148:13
|
148 | T::CONTROL_BYTE,
| ^^^^^^^^^^^^^^^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
error: could not compile `jetscii` due to 2 previous errors
Why is Rust compiling jetscii? How do I fix this error?