The concat function is broken in version 0.10.16. It inserts a separator even for an empty list, see the example:
let t = concat([1, 2].iter().map(|_x| RcDoc::text("2")), ",")
.pretty(LINE_WIDTH)
.to_string();
println!("{t}");
let t = concat([1].iter().map(|_x| RcDoc::text("1")), ",")
.pretty(LINE_WIDTH)
.to_string();
println!("{t}");
let v: Vec<u8> = Vec::new();
let t = concat(v.iter().map(|_x| RcDoc::text("0")), ",")
.pretty(LINE_WIDTH)
.to_string();
println!("{t}");
before it was producing:
It now produces:
The
concatfunction is broken in version 0.10.16. It inserts a separator even for an empty list, see the example:before it was producing:
It now produces: