blob: ad25eefafd5899f94f5e28e4cd5e5c210b112506 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
extern crate reqwest;
use utils;
use super::rlua::prelude::*;
use self::LuaError::RuntimeError;
pub fn download(_: &Lua, url: String) -> Result<String, LuaError> {
match utils::download(1024, &url) {
Some(v) => Ok(v),
None => Err(RuntimeError(format!("Failed to download {}", url))),
}
}
|