Fmt.
This commit is contained in:
@@ -9,8 +9,7 @@ pub struct Hitta;
|
||||
impl Probe for Hitta {
|
||||
fn search(&mut self, ctx: &mut Context, number: &str) {
|
||||
let body = if let Some(cache) = ctx.cache_get("hitta", &number) {
|
||||
String::from_utf8(cache.data)
|
||||
.unwrap()
|
||||
String::from_utf8(cache.data).unwrap()
|
||||
} else {
|
||||
reqwest::get(&format!("https://www.hitta.se/vem-ringde/{}", number))
|
||||
.unwrap()
|
||||
@@ -18,7 +17,8 @@ impl Probe for Hitta {
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
ctx.cache_set("hitta", &number, body.as_bytes()).expect("wut?! why not?!");
|
||||
ctx.cache_set("hitta", &number, body.as_bytes())
|
||||
.expect("wut?! why not?!");
|
||||
|
||||
let document = Html::parse_document(&body);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user