Replace last bail! invocations.
This commit is contained in:
parent
008f57bec4
commit
44ebe46f10
@ -46,6 +46,10 @@ pub enum DataError {
|
||||
},
|
||||
#[fail(display = "Error occured while Parsing an Episode. Reason: {}", reason)]
|
||||
ParseEpisodeError { reason: String, parent_id: i32 },
|
||||
#[fail(display = "No Futures where produced to be run.")]
|
||||
EmptyFuturesList,
|
||||
#[fail(display = "Episode was not changed and thus skipped.")]
|
||||
EpisodeNotChanged,
|
||||
}
|
||||
|
||||
impl From<RunMigrationsError> for DataError {
|
||||
|
||||
@ -96,7 +96,7 @@ impl Feed {
|
||||
// I am not sure what the optimizations are on match vs allocating None.
|
||||
.map(|fut| {
|
||||
fut.and_then(|x| match x {
|
||||
IndexState::NotChanged => return Err(DataError::DiscountBail(format!("Nothing to do here."))),
|
||||
IndexState::NotChanged => return Err(DataError::EpisodeNotChanged),
|
||||
_ => Ok(x),
|
||||
})
|
||||
})
|
||||
|
||||
@ -27,7 +27,7 @@ extern crate derive_builder;
|
||||
extern crate diesel;
|
||||
#[macro_use]
|
||||
extern crate diesel_migrations;
|
||||
#[macro_use]
|
||||
// #[macro_use]
|
||||
extern crate failure;
|
||||
#[macro_use]
|
||||
extern crate failure_derive;
|
||||
|
||||
@ -58,9 +58,7 @@ pub fn pipeline<S: IntoIterator<Item = Source>>(
|
||||
.collect();
|
||||
|
||||
if list.is_empty() {
|
||||
return Err(DataError::DiscountBail(format!(
|
||||
"No futures were found to run."
|
||||
)));
|
||||
return Err(DataError::EmptyFuturesList);
|
||||
}
|
||||
|
||||
// Thats not really concurrent yet I think.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user