Skip to main content

from_lines

Function from_lines 

Source
pub fn from_lines(lines: Vec<String>) -> Value
Expand description

Converts a line list back into a value.

No lines becomes null, which emits nothing: a grep that matched nothing must print nothing, where an empty string would print a phantom blank line and spend a line of the output ceiling. A single line becomes a string so that echo hi | grep hi stays scalar; anything else becomes a JSON array of lines so that later jq or index expressions see real structure.