diff options
author | Teddy Wing | 2019-11-02 01:53:52 +0100 |
---|---|---|
committer | Teddy Wing | 2019-11-02 01:53:52 +0100 |
commit | 950c7d1a93ae44da2584345e4a2624d64ef84816 (patch) | |
tree | 4b1fdcdd98a7fc49a8bd93bfb7b27397c306de9f /src/main.rs | |
parent | 65305566946555ec78596e57e48c551a3dbf9dc8 (diff) | |
download | pdf-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.rs | 6 |
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), } } |