Removed 2 trait implementations were unused by slicec-cs.
One was for converting iterators of strings into CodeBlocks, this is very niche, so the one place we used it was probably deleted.
The other was for converting CodeBlocks to Strings. This was just redundant. We always call to_string on CodeBlocks, or pass them into format! macros (which internally calls to_string), so we never directly convert CodeBlocks to Strings.
It also changes indent and add_block to take owned parameters, instead of &muts.
Because right now we're doing lots of:
add_block(&builder.build()) and add_block(&format!(...))
This change will let us remove that & in the middle. There's no real reason for it tbh, except that our API here demands it.
Removed 2 trait implementations were unused by
slicec-cs
. One was for converting iterators of strings into CodeBlocks, this is very niche, so the one place we used it was probably deleted. The other was for converting CodeBlocks to Strings. This was just redundant. We always callto_string
on CodeBlocks, or pass them intoformat!
macros (which internally callsto_string
), so we never directly convert CodeBlocks to Strings.It also changes
indent
andadd_block
to take owned parameters, instead of&mut
s. Because right now we're doing lots of:add_block(&builder.build())
andadd_block(&format!(...))
This change will let us remove that&
in the middle. There's no real reason for it tbh, except that our API here demands it.