I reckon this would be clearer as `let delim = "#".repeat(n); lit.push_str(delim); ... ; lit.push_str(delim);` and this is highly unlikely to be a critical path on which we must avoid allocations.