summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-07-10 14:56:12 -0400
committerGitHub <noreply@github.com>2018-07-10 14:56:12 -0400
commitd160de7f445e5d79883f2e8d97584b8afd009cc7 (patch)
treec446aa21cafba061088b330c29aae0863c5e6049 /src
parente269d972d2ab64418e2cdf1565c80b472fafd3b1 (diff)
Add rust url crate. (#355)
Diffstat (limited to 'src')
-rw-r--r--src/handlers.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index 2b8e51602..c826af7c0 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -1,9 +1,11 @@
// Copyright 2018 Ryan Dahl <ry@tinyclouds.org>
// All rights reserved. MIT License.
extern crate libc;
+extern crate url;
use libc::c_char;
use std::ffi::CStr;
+use url::Url;
fn string_from_ptr(ptr: *const c_char) -> String {
let cstr = unsafe { CStr::from_ptr(ptr as *const i8) };
@@ -11,8 +13,9 @@ fn string_from_ptr(ptr: *const c_char) -> String {
}
#[test]
-fn test_example() {
- assert_eq!(2 + 2, 4);
+fn test_url() {
+ let issue_list_url = Url::parse("https://github.com/rust-lang").unwrap();
+ assert!(issue_list_url.scheme() == "https");
}
#[no_mangle]