(value: &str)
| 1184 | } |
| 1185 | |
| 1186 | fn percent_encode_query_component(value: &str) -> String { |
| 1187 | let mut encoded = String::new(); |
| 1188 | for byte in value.bytes() { |
| 1189 | if byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.' | b'~') { |
| 1190 | encoded.push(byte as char); |
| 1191 | } else { |
| 1192 | encoded.push_str(&format!("%{byte:02X}")); |
| 1193 | } |
| 1194 | } |
| 1195 | encoded |
| 1196 | } |
| 1197 | |
| 1198 | fn percent_decode_query_component(value: &str) -> String { |
| 1199 | let mut decoded = Vec::with_capacity(value.len()); |