Add util: is_url(String) -> bool

This commit is contained in:
Matthias Beyer 2015-12-28 18:46:36 +01:00
parent 8ba7e34e34
commit 16d40e9bfe
2 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,7 @@ mod runtime;
mod module; mod module;
mod storage; mod storage;
mod ui; mod ui;
mod util;
use module::bm::BM; use module::bm::BM;

6
src/util/mod.rs Normal file
View file

@ -0,0 +1,6 @@
use url::Url;
pub fn is_url(url: &String) -> bool {
Url::parse(&url[..]).is_ok()
}