mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 19:15:46 +00:00
d5f5648b37
We use cargo vendor to generate a .cargo/config file and the vendor directory. Vendoring allows us to lock our dependencies and to modify them easily from the top level Cargo.toml. We vendor all dependencies, including the crates.io ones, which allows for network isolated builds. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
22 lines
686 B
Rust
22 lines
686 B
Rust
#[cfg(feature = "term_size")]
|
|
extern crate textwrap;
|
|
|
|
#[cfg(not(feature = "term_size"))]
|
|
fn main() {
|
|
println!("Please enable the term_size feature to run this example.");
|
|
}
|
|
|
|
#[cfg(feature = "term_size")]
|
|
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 = textwrap::Wrapper::with_termwidth();
|
|
println!("Formatted in within {} columns:", wrapper.width);
|
|
println!("----");
|
|
println!("{}", wrapper.fill(example));
|
|
println!("----");
|
|
}
|