From 4aab03c67869ff4ecc473794f62e35e4565a01d6 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 29 May 2020 22:22:30 +0100 Subject: Make reqwest build on wasm --- dhall/src/semantics/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dhall/src/semantics/parse.rs') diff --git a/dhall/src/semantics/parse.rs b/dhall/src/semantics/parse.rs index 2326471..82396e0 100644 --- a/dhall/src/semantics/parse.rs +++ b/dhall/src/semantics/parse.rs @@ -4,7 +4,7 @@ use std::path::Path; use url::Url; use crate::error::Error; -use crate::semantics::resolve::ImportLocation; +use crate::semantics::resolve::{download_http_text, ImportLocation}; use crate::syntax::binary; use crate::syntax::parse_expr; use crate::Parsed; @@ -17,7 +17,7 @@ pub fn parse_file(f: &Path) -> Result { } pub fn parse_remote(url: Url) -> Result { - let body = reqwest::blocking::get(url.clone()).unwrap().text().unwrap(); + let body = download_http_text(url.clone())?; let expr = parse_expr(&body)?; let root = ImportLocation::Remote(url); Ok(Parsed(expr, root)) -- cgit v1.2.3