While compiling the example I got the below errors and warnings:
Compiling rust v0.1.0 (/Users/hasan/PycharmProjects/rust)
warning: trait objects without an explicit `dyn` are deprecated
--> src/main.rs:26:25
|
26 | let mut output: Box<OutputDev> = match output_kind.as_ref() {
| ^^^^^^^^^ help: use `dyn`: `dyn OutputDev`
|
= note: `#[warn(bare_trait_objects)]` on by default
warning: trait objects without an explicit `dyn` are deprecated
--> src/main.rs:27:74
|
27 | "txt" => Box::new(PlainTextOutput::new(&mut output_file as (&mut std::io::Write))),
| ^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::io::Write`
error[E0308]: mismatched types
--> src/main.rs:24:20
|
24 | print_metadata(&doc);
| ^^^^ expected struct `lopdf::document::Document`, found a different struct `lopdf::document::Document`
|
= note: expected type `&lopdf::document::Document` (struct `lopdf::document::Document`)
found type `&lopdf::document::Document` (struct `lopdf::document::Document`)
note: Perhaps two different versions of crate `lopdf` are being used?
--> src/main.rs:24:20
|
24 | print_metadata(&doc);
| ^^^^
error[E0308]: mismatched types
--> src/main.rs:33:16
|
33 | output_doc(&doc, output.as_mut());
| ^^^^ expected struct `lopdf::document::Document`, found a different struct `lopdf::document::Document`
|
= note: expected type `&lopdf::document::Document` (struct `lopdf::document::Document`)
found type `&lopdf::document::Document` (struct `lopdf::document::Document`)
note: Perhaps two different versions of crate `lopdf` are being used?
--> src/main.rs:33:16
|
33 | output_doc(&doc, output.as_mut());
| ^^^^
error: aborting due to 2 previous errors
While compiling the example I got the below errors and warnings: