Initial draft of hammond-data/src/index_feed.rs API redesign.

This commit is contained in:
Jordan Petridis
2017-11-17 13:26:39 +02:00
parent 3c6176b1c0
commit 54a0f17588
5 changed files with 129 additions and 122 deletions
+3 -2
View File
@@ -15,7 +15,7 @@ use rand::Rng;
use test::Bencher;
use hammond_data::run_migration_on;
use hammond_data::index_feed::{complete_index, insert_return_source, Database};
use hammond_data::index_feed::{index_feeds, insert_return_source, Database, Feed};
// use std::io::BufRead;
use std::path::PathBuf;
@@ -63,9 +63,10 @@ fn index_urls(m: &Database) {
};
// parse it into a channel
let chan = rss::Channel::read_from(buff).unwrap();
let feed = Feed(chan, s);
// Index the channel
complete_index(m, &chan, &s).unwrap();
index_feeds(m, &mut [feed]);
});
}