Function shlex::bytes::quote

source ·
pub fn quote(in_bytes: &[u8]) -> Cow<'_, [u8]>
👎Deprecated since 1.3.0: replace with try_quote(str)? to avoid nul byte danger
Expand description

Given a single word, return a string suitable to encode it as a shell argument.

Uses default settings except that nul bytes are passed through, which may be dangerous, leading to this function being deprecated.

Equivalent to Quoter::new().allow_nul(true).quote(in_bytes).unwrap().

(That configuration never returns Err, so this function does not panic.)

The string equivalent is shlex::quote.