diff --git a/pdf/examples/content.rs b/pdf/examples/content.rs index 7f90ea1..9652407 100644 --- a/pdf/examples/content.rs +++ b/pdf/examples/content.rs @@ -14,6 +14,7 @@ use pdf::build::*; use pdf::primitive::PdfString; +#[cfg(feature="cache")] fn main() -> Result<(), PdfError> { let path = PathBuf::from(env::args_os().nth(1).expect("no file given")); diff --git a/pdf/examples/metadata.rs b/pdf/examples/metadata.rs index 3900d2a..4fba7e9 100644 --- a/pdf/examples/metadata.rs +++ b/pdf/examples/metadata.rs @@ -5,6 +5,7 @@ use pdf::file::{FileOptions}; use pdf::object::{FieldDictionary, FieldType, Resolve}; /// extract and print a PDF's metadata +#[cfg(feature="cache")] fn main() -> Result<(), PdfError> { let path = args() .nth(1) diff --git a/pdf/examples/names.rs b/pdf/examples/names.rs index fe89f01..82cd8b0 100644 --- a/pdf/examples/names.rs +++ b/pdf/examples/names.rs @@ -60,6 +60,7 @@ fn walk_outline(r: &impl Resolve, mut node: RcRef, name_map: &impl } } +#[cfg(feature="cache")] fn main() { let path = args().nth(1).expect("no file given"); println!("read: {}", path); diff --git a/pdf/examples/other_page_content.rs b/pdf/examples/other_page_content.rs index fbe31bc..52ac453 100644 --- a/pdf/examples/other_page_content.rs +++ b/pdf/examples/other_page_content.rs @@ -8,6 +8,7 @@ use std::env::args; /// Extract data from a page entry that is under "other". /// This example looks for stikethroughs in the annotations entry /// and returns a Vec for the bounds of the struckthrough text. +#[cfg(feature="cache")] fn main() -> Result<(), PdfError> { let path = args() .nth(1) diff --git a/pdf/examples/read.rs b/pdf/examples/read.rs index b4f4b61..c9d30c4 100644 --- a/pdf/examples/read.rs +++ b/pdf/examples/read.rs @@ -21,6 +21,7 @@ impl Log for VerboseLog { } } +#[cfg(feature="cache")] fn main() -> Result<(), PdfError> { let path = args().nth(1).expect("no file given"); println!("read: {}", path); diff --git a/pdf/tests/integration.rs b/pdf/tests/integration.rs index 9426231..fdfc9a3 100644 --- a/pdf/tests/integration.rs +++ b/pdf/tests/integration.rs @@ -21,7 +21,7 @@ macro_rules! run { #[test] fn open_file() { let _ = run!(FileOptions::uncached().open(file_path!("example.pdf"))); - #[cfg(feature = "mmap")] + #[cfg(all(feature = "mmap", feature = "cache"))] let _ = run!({ use memmap2::Mmap; let file = std::fs::File::open(file_path!("example.pdf")).expect("can't open file");