diff options
| -rw-r--r-- | src/lib.rs | 6 | ||||
| -rw-r--r-- | src/main.rs | 5 | 
2 files changed, 8 insertions, 3 deletions
| @@ -1,9 +1,11 @@  extern crate lopdf; +use std::path::Path; +  use lopdf::{Document, Object}; -pub fn get_urls_from_pdf() { -    let doc = Document::load("example.pdf").unwrap(); +pub fn get_urls_from_pdf(path: &Path) { +    let doc = Document::load(path).unwrap();      for (_, obj) in doc.objects {          match obj { diff --git a/src/main.rs b/src/main.rs index 3964551..789e383 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,8 @@ +use std::path::Path; +  use pdf_urls::get_urls_from_pdf;  fn main() { -    get_urls_from_pdf(); +    let path = Path::new("example.pdf"); +    get_urls_from_pdf(&path);  } | 
