aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTeddy Wing2019-11-02 01:53:52 +0100
committerTeddy Wing2019-11-02 01:53:52 +0100
commit950c7d1a93ae44da2584345e4a2624d64ef84816 (patch)
tree4b1fdcdd98a7fc49a8bd93bfb7b27397c306de9f /src/main.rs
parent65305566946555ec78596e57e48c551a3dbf9dc8 (diff)
downloadpdf-urls-950c7d1a93ae44da2584345e4a2624d64ef84816.tar.bz2
get_urls_from_pdf: Return a `Vec<String>` instead of printing
Facilitate testing by returning a vec of URLs instead of printing them directly to STDOUT.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 9bd5c37..049fcd2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,7 +2,11 @@ use pdf_urls::get_urls_from_pdf;
fn main() {
match get_urls_from_pdf("example.pdf") {
- Ok(_) => (),
+ Ok(urls) => {
+ for url in urls {
+ println!("{}", url);
+ }
+ },
Err(err) => eprintln!("error: {}", err),
}
}