MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / percent_encode

Function percent_encode

packages/server/src/main.rs:3579–3590  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

3577}
3578
3579fn percent_encode(value: &str) -> String {
3580 let mut encoded = String::new();
3581 for byte in value.as_bytes() {
3582 match byte {
3583 b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'.' | b'_' | b'~' => {
3584 encoded.push(*byte as char);
3585 }
3586 _ => encoded.push_str(&format!("%{byte:02X}")),
3587 }
3588 }
3589 encoded
3590}
3591
3592fn main() -> anyhow::Result<()> {
3593 logging::init();

Callers 2

simdeck_pair_urlFunction · 0.85
simdeck_open_linkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected