mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 13:40:17 -10:00
19 lines
476 B
Rust
19 lines
476 B
Rust
extern crate textwrap;
|
|
|
|
use textwrap::Wrapper;
|
|
|
|
fn main() {
|
|
let example = "
|
|
Memory safety without garbage collection.
|
|
Concurrency without data races.
|
|
Zero-cost abstractions.
|
|
";
|
|
// Create a new Wrapper -- automatically set the width to the
|
|
// current terminal width.
|
|
let wrapper = Wrapper::with_termwidth();
|
|
println!("Formatted in within {} columns:", wrapper.width);
|
|
println!("----");
|
|
println!("{}", wrapper.fill(example));
|
|
println!("----");
|
|
}
|