reduce dependency bloat
This commit is contained in:
parent
5782951e68
commit
11ba2b1470
11 changed files with 249 additions and 2225 deletions
|
|
@ -19,8 +19,11 @@ const IP_REQ_SERVICE_URL: &str = "https://ipinfo.io/ip";
|
|||
|
||||
|
||||
fn try_get_ip() -> Result<Ipv4Addr, Box<dyn Error>> {
|
||||
let req = reqwest::blocking::get(IP_REQ_SERVICE_URL)?;
|
||||
Ok(req.text()?.parse()?)
|
||||
let mut req = ureq::get(IP_REQ_SERVICE_URL)
|
||||
.call()?;
|
||||
|
||||
|
||||
Ok(req.body_mut().read_to_string()?.parse()?)
|
||||
}
|
||||
|
||||
pub static OWN_IP_PRIVATE: Lazy<Ipv4Addr> = Lazy::new(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue