Function shlex::bytes::join

source ·
pub fn join<'a, I: IntoIterator<Item = &'a [u8]>>(words: I) -> Vec<u8>
👎Deprecated since 1.3.0: replace with try_join(words)? to avoid nul byte danger
Expand description

Convenience function that consumes an iterable of words and turns it into a single byte string, quoting words when necessary. Consecutive words will be separated by a single space.

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).join(words).unwrap().

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

The string equivalent is shlex::join.