-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Hi,
I was trying to play around with the following example from the docs, and I noticed that cargo fmt
was putting a space between the two hyphens in --version
.
use anyhow::Result;
use cmd_lib::run_fun;
fn main() -> Result<()> {
let version = run_fun!(rustc - -version)?; // cargo fmt messes this line up
println!("Your rust version is {}", version);
// with pipes
let n = run_fun!(echo "the quick brown fox jumped over the lazy dog" | wc -w)?;
println!("There are {} words in above sentence", n);
println!("Hello, world!");
Ok(())
}
If I do this, cargo fmt
doesn't mess with the syntax.
let version = run_fun!(rustc "--version")?;
println!("Your rust version is {}", version);
Metadata
Metadata
Assignees
Labels
No labels