Skip to content

Commit

Permalink
fix build failure when running tests without cache feature (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzap committed Jan 18, 2024
1 parent db1120c commit c3b09d7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pdf/examples/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
1 change: 1 addition & 0 deletions pdf/examples/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pdf/examples/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ fn walk_outline(r: &impl Resolve, mut node: RcRef<OutlineItem>, name_map: &impl
}
}

#[cfg(feature="cache")]
fn main() {
let path = args().nth(1).expect("no file given");
println!("read: {}", path);
Expand Down
1 change: 1 addition & 0 deletions pdf/examples/other_page_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Rect> for the bounds of the struckthrough text.
#[cfg(feature="cache")]
fn main() -> Result<(), PdfError> {
let path = args()
.nth(1)
Expand Down
1 change: 1 addition & 0 deletions pdf/examples/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pdf/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c3b09d7

Please sign in to comment.