Remove unwrap call.
This commit is contained in:
parent
8ba9f928d6
commit
e84e7df3f1
@ -30,7 +30,7 @@ pub enum DataError {
|
|||||||
#[fail(display = "TLS Error: {}", _0)]
|
#[fail(display = "TLS Error: {}", _0)]
|
||||||
TLSError(#[cause] native_tls::Error),
|
TLSError(#[cause] native_tls::Error),
|
||||||
#[fail(display = "IO Error: {}", _0)]
|
#[fail(display = "IO Error: {}", _0)]
|
||||||
IOError(io::Error),
|
IOError(#[cause] io::Error),
|
||||||
#[fail(display = "WANNABE BAIL ERROR: {}", _0)]
|
#[fail(display = "WANNABE BAIL ERROR: {}", _0)]
|
||||||
DiscountBail(String),
|
DiscountBail(String),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,8 +241,10 @@ fn response_to_channel(
|
|||||||
.map_err(From::from)
|
.map_err(From::from)
|
||||||
.map(|iter| iter.collect::<Vec<u8>>())
|
.map(|iter| iter.collect::<Vec<u8>>())
|
||||||
.map(|utf_8_bytes| String::from_utf8_lossy(&utf_8_bytes).into_owned())
|
.map(|utf_8_bytes| String::from_utf8_lossy(&utf_8_bytes).into_owned())
|
||||||
// FIXME: Unwrap
|
.and_then(|buf| {
|
||||||
.and_then(|buf| Ok(Channel::from_str(&buf).unwrap()));
|
Channel::from_str(&buf)
|
||||||
|
.or_else(|_| Err(DataError::DiscountBail(format!("RSS crate Error"))))
|
||||||
|
});
|
||||||
let cpu_chan = pool.spawn(chan);
|
let cpu_chan = pool.spawn(chan);
|
||||||
Box::new(cpu_chan)
|
Box::new(cpu_chan)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user