mozilla/rust — pull request #2850 by dbp (2012-07-09 18:22:50+00:00)
Title: Adding simple net::url module to parse and format urls. As per Issue #2661.

This does basic parsing and formatting of urls. I wrote it based on https://github.com/mozilla/rust/issues/2661 .

It does not do url encoding/decoding, which hopefully could be integrated from https://github.com/erickt/rust-uri (the main reason I didn't write it).

It also does barely any validation, mainly because this is my first time writing rust code and I wanted to make sure that it looked alright before making the library too complicated. The main thing that I wanted to get with this initial stab was the external interface - the types and function signatures. The test cases should reflect this limitation - they only test valid urls.

The library is designed to be used qualified (ie, url::to_str, url::from_str), though if that is not the proper style, it can easily be changed.

Either way - feedback is welcome (on style, interface, correctness, etc).