Use ? instead of match where appropriate
This commit is contained in:
parent
17d375a5dc
commit
7f717d30b7
2 changed files with 10 additions and 28 deletions
src/config
|
@ -102,12 +102,9 @@ impl Config {
|
|||
let mut post_queue: Vec<CreatePost> = vec![];
|
||||
|
||||
match self.feeds.iter().map(|feed| {
|
||||
let res = match CLIENT
|
||||
let res = CLIENT
|
||||
.get(feed.feed_url.clone())
|
||||
.send() {
|
||||
Ok(data) => data.text().unwrap(),
|
||||
Err(e) => return Err(e)
|
||||
};
|
||||
.send()?.text()?;
|
||||
|
||||
let data: FeedData = serde_json::from_str(&res).unwrap();
|
||||
|
||||
|
@ -281,13 +278,10 @@ impl CommunitiesVector {
|
|||
..Default::default()
|
||||
};
|
||||
|
||||
let res = match CLIENT
|
||||
let res = CLIENT
|
||||
.get(base.clone() + "/api/v3/community/list")
|
||||
.query(¶ms)
|
||||
.send() {
|
||||
Ok(data) => data.text().unwrap(),
|
||||
Err(e) => return Err(e)
|
||||
};
|
||||
.send()?.text()?;
|
||||
|
||||
let site_data: ListCommunitiesResponse = serde_json::from_str(&res).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue