From d160de7f445e5d79883f2e8d97584b8afd009cc7 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 10 Jul 2018 14:56:12 -0400 Subject: Add rust url crate. (#355) --- src/handlers.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 // 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] -- cgit v1.2.3