Skip to content

Commit 6f90be3

Browse files
author
bors-servo
committed
Auto merge of #130 - conradkleinespel:patch-1, r=SimonSapin
Adds docs for form_urlencoded::parse Hello, I found myself wondering if this function would actually decode the values, as opposed to just splitting on the `=` sign and making some validity checks. I would be nice to have docs just say that the names/values are decoded. Best regards, Conrad <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/130) <!-- Reviewable:end -->
2 parents 8e21f61 + 1524703 commit 6f90be3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/form_urlencoded.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ use percent_encoding::{percent_encode_to, percent_decode, FORM_URLENCODED_ENCODE
2323
/// into a vector of (name, value) pairs.
2424
///
2525
/// Use `parse(input.as_bytes())` to parse a `&str` string.
26+
///
27+
/// The names and values are URL-decoded. For instance, `%23first=%25try%25` will be
28+
/// converted to `[("#first", "%try%")]`.
2629
#[inline]
2730
pub fn parse(input: &[u8]) -> Vec<(String, String)> {
2831
parse_internal(input, EncodingOverride::utf8(), false).unwrap()

0 commit comments

Comments
 (0)