aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 45400c6..9672d33 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -590,15 +590,17 @@ impl Uri {
}
}
- // TODO: look into making element type more flexible
- fn decode_element(
- element: &str,
+ fn decode_element<T>(
+ element: T,
allowed_characters: &'static HashSet<char>,
context: Context
- ) -> Result<Vec<u8>, Error> {
+ ) -> Result<Vec<u8>, Error>
+ where T: AsRef<str>
+ {
let mut decoding_pec = false;
let mut pec_decoder = PercentEncodedCharacterDecoder::new();
element
+ .as_ref()
.chars()
.filter_map(|c| {
if decoding_pec {