summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-12-05 14:57:41 +0100
committerMatthias Beyer <mail@beyermatthias.de>2017-01-25 09:54:09 +0100
commit64c611847b6abfb8c70a160e97d6666ca82b2692 (patch)
tree4e677dd7aed06624021118a3e77e16081066e9f4
parent03a90c9bf9ae4558842b30d0bce2968879e6efa8 (diff)
Fix: Only list internal links here, no external ones
Funny side note: As the commit history reveals, I wasn't active in this repository for some time. I first implemented a solution for this problem in about 50 lines of code. Then I thought that this could be done way simpler, so I rewrote it in about 20 lines. Finally, I noticed that I already have infrastructure for this, so this two-line patch should fix the problem. Know your codebase, dude!
-rw-r--r--imag-link/src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs
index 6f686683..d583d5ca 100644
--- a/imag-link/src/main.rs
+++ b/imag-link/src/main.rs
@@ -84,6 +84,7 @@ fn main() {
fn handle_internal_linking(rt: &Runtime) {
use libimagentrylink::internal::InternalLinker;
+ use libimagentrylink::external::iter::NoExternalIter;
debug!("Handle internal linking call");
let cmd = rt.cli().subcommand_matches("internal").unwrap();
@@ -96,6 +97,7 @@ fn handle_internal_linking(rt: &Runtime) {
match get_entry_by_name(rt, entry) {
Ok(Some(e)) => {
e.get_internal_links()
+ .map(NoExternalIter::new)
.map(|links| {
let i = links
.filter_map(|l| {