MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / percent_encode_query_component

Function percent_encode_query_component

packages/server/src/devtools.rs:1186–1196  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

1184}
1185
1186fn 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
1198fn percent_decode_query_component(value: &str) -> String {
1199 let mut decoded = Vec::with_capacity(value.len());

Callers

nothing calls this directly

Calls 1

bytesMethod · 0.65

Tested by

no test coverage detected