join-lazy-fmt
Lazy
separator.join(iterable)
method andlazy_format!
for Rust
Usage
-
Add the following line to your
Cargo.toml
, under[dependencies]
= "0.9.2"
-
Add the folowing line to your
.rs
code to bring items in scope:use *;
Example
use *;
let sequence = format!;
assert_eq!;
// Since `.join()` is lazy, this does not compute an infinite string.
let _ = ", ".join;
const N: usize = 6;
let line = format!;
// And the following allocates only one `String`:
let matrix = format!;
assert_eq!;