ohkami_lib 0.24.9

internal library for Ohkami - A performant, declarative, and runtime-flexible web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::{borrow::Cow, str::Utf8Error};

#[inline(always)]
pub fn percent_decode_utf8(input: &[u8]) -> Result<Cow<'_, str>, Utf8Error> {
    ::percent_encoding::percent_decode(input).decode_utf8()
}
#[inline(always)]
pub fn percent_decode(input: &[u8]) -> Cow<'_, [u8]> {
    ::percent_encoding::percent_decode(input).into()
}

#[inline(always)]
pub fn percent_encode(input: &str) -> Cow<'_, str> {
    ::percent_encoding::percent_encode(input.as_bytes(), ::percent_encoding::NON_ALPHANUMERIC)
        .into()
}