aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs2
-rw-r--r--src/main.rs5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 82e58fd..f1ac517 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,7 @@ use std::path::Path;
use lopdf::{Document, Object};
-pub fn get_urls_from_pdf(path: &Path) {
+pub fn get_urls_from_pdf<P: AsRef<Path>>(path: P) {
let doc = Document::load(path).unwrap();
for (_, obj) in doc.objects {
diff --git a/src/main.rs b/src/main.rs
index 789e383..14eab24 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,8 +1,5 @@
-use std::path::Path;
-
use pdf_urls::get_urls_from_pdf;
fn main() {
- let path = Path::new("example.pdf");
- get_urls_from_pdf(&path);
+ get_urls_from_pdf("example.pdf");
}