From 64c611847b6abfb8c70a160e97d6666ca82b2692 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Dec 2016 14:57:41 +0100 Subject: 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! --- imag-link/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) 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| { -- cgit v1.2.3