The scenario is this.
In your test functions, you have:
#[test]
fn test_ls() {
let process = Command::new(ls).arg("ln");
// we then test that ls works as expected
}
and we want to show the same example in our docs, but showing let process = Command::new(ls).arg("ln") is not great. Ideally, we want to use Debug/Display impl of the same process variable, which will nicely format it as ls -ln.
I suppose this can be done with
#[test]
fn test_ls() {
#[docify::export_display]
let process = Command::new(ls).arg("ln");
// we then test that ls works as expected
}
This is a very limited use-case. We can easily limit it to only work in assignment expressions, drop the lhs, assert rhs is a Command etc.
The scenario is this.
In your test functions, you have:
and we want to show the same example in our docs, but showing
let process = Command::new(ls).arg("ln")is not great. Ideally, we want to useDebug/Displayimpl of the sameprocessvariable, which will nicely format it asls -ln.I suppose this can be done with
This is a very limited use-case. We can easily limit it to only work in assignment expressions, drop the lhs, assert rhs is a
Commandetc.