Compare commits

...

2 Commits

Author SHA1 Message Date
Wyatt J. Miller
7684a61296 updated async-std crate 2020-12-27 22:18:18 -05:00
Wyatt J. Miller
15917726d7 updated reqwest create, added async features 2020-12-20 14:24:24 -05:00
3 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,7 @@
authors = ["Wyatt J. Miller <wjmiller2016@gmail.com>"]
edition = "2018"
name = "bleak"
version = "0.3.0"
version = "0.3.1"
[dependencies]
chrono = "0.4.11"
@ -15,12 +15,15 @@ serde_json = "1.0.53"
smart-leds = "0.3.0"
ws2812-spi = "0.3.0"
[dependencies.async-std]
version = "1.8.0"
[dependencies.rppal]
features = ["hal"]
version = "0.11.3"
[dependencies.reqwest]
version = "0.9.24"
version = "0.10.9"
[dependencies.openssl]
features = ["vendored"]

View File

@ -1,3 +1,4 @@
use async_std::{prelude::*, task};
use std::fs::File;
use std::io::Read;
use std::path::Path;
@ -38,7 +39,7 @@ impl Configuration {
port = self.port
);
let response = request::get_request(&request);
let response = task::block_on(request::get_request(&request));
match response {
Ok(res) => {
@ -61,7 +62,7 @@ impl Configuration {
port = self.port
);
let response = request::get_request(&request);
let response = task::block_on(request::get_request(&request));
match response {
Ok(res) => {
let document = Document::from_read(res)

View File

@ -1,4 +1,6 @@
pub fn get_request(request: &String) -> Result<reqwest::Response, reqwest::Error> {
let response = reqwest::get(request);
use async_std::{prelude::*, io};
pub async fn get_request(request: &String) -> io::Result<reqwest::Response, reqwest::Error> {
let response = reqwest::get(request).await?;
response
}