pub const fn new(s: &str) -> &EStr {
        if imp::validate_estr(s.as_bytes()) {
            // SAFETY: We have done the validation.
            unsafe { EStr::new_unchecked(s.as_bytes()) }
        } else {
            panic!("invalid percent-encoded string");
        }
    }
/// Converts a string slice to an `EStr`.
///
/// # Panics
///
/// Panics if the string is not properly encoded.
Converts a string slice to an `EStr`.
Converts a string slice to an ` EStr ` .
pub const fn new(s: &str) -> &EStr {
        if imp::validate_estr(s.as_bytes()) {
            // SAFETY: We have done the validation.
            unsafe { EStr::new_unchecked(s.as_bytes()) }
        } else {
            panic!("invalid percent-encoded string");
        }
    }
pub const fn new ( s : & str ) -> & EStr { if imp :: validate_estr ( s . as_bytes ( ) ) { // SAFETY: We have done the validation. unsafe { EStr :: new_unchecked ( s . as_bytes ( ) ) } } else { panic ! ( " " ) ; } }
Converts a string slice to an `EStr`.
Converts a string slice to an ` EStr ` .
s
&str
s
&str
panics
Panics if the string is not properly encoded.
Panics if the string is not properly encoded .