summaryrefslogtreecommitdiffstats
path: root/src/http/forms.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/forms.rs')
-rw-r--r--src/http/forms.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/http/forms.rs b/src/http/forms.rs
index 579b931..802855b 100644
--- a/src/http/forms.rs
+++ b/src/http/forms.rs
@@ -9,15 +9,12 @@ pub fn decode(s: &str) -> String {
i += 1;
}
b'%' if i + 2 < bytes.len() => {
- match u8::from_str_radix(&s[i + 1..i + 3], 16) {
- Ok(v) => {
- out.push(v);
- i += 3;
- }
- Err(_) => {
- out.push(bytes[i]);
- i += 1;
- }
+ if let Ok(v) = u8::from_str_radix(&s[i + 1..i + 3], 16) {
+ out.push(v);
+ i += 3;
+ } else {
+ out.push(bytes[i]);
+ i += 1;
}
}
c => {