tovuk 0.1.67

Deploy Rust workers, static frontends, and worker-static apps to Tovuk.
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::fmt::Write as _;

pub(crate) fn encode_component(value: &str) -> String {
    let mut output = String::new();
    for byte in value.bytes() {
        if byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.' | b'~') {
            output.push(char::from(byte));
        } else {
            let _ = write!(output, "%{byte:02X}");
        }
    }
    output
}