From 9251b21bc5d20beafc68bdfffeb906951fc90e82 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sun, 1 Oct 2017 10:57:22 +0300 Subject: [PATCH] More splitting. --- src/index_feed.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/index_feed.rs b/src/index_feed.rs index ee7365e..8a0791e 100644 --- a/src/index_feed.rs +++ b/src/index_feed.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use diesel::prelude::*; use diesel; use rss; @@ -98,8 +100,18 @@ fn complete_index_from_source( req.read_to_string(&mut buf)?; let chan = rss::Channel::from_str(&buf)?; + complete_index(mutex, chan, &source)?; + + Ok(()) +} + +fn complete_index( + mutex: Arc>, + chan: rss::Channel, + parent: &Source +) -> Result<()>{ let tempdb = mutex.lock().unwrap(); - let pd = index_channel(&tempdb, &chan, &source)?; + let pd = index_channel(&tempdb, &chan, parent)?; drop(tempdb); index_channel_items(mutex.clone(), chan.items(), &pd)?;