Open zackw opened 1 year ago
Huh, can't remember why I did that but it doesn't mean you can't pass in strings at runtime but that you must transfer ownership. A Cow
can be both a borrowed and an owned string.
.stdout(predicate::str::diff(
str::from_utf8(help_output.stdout.clone()).unwrap()
));
Most of the string predicates accept an argument that can vary at runtime (usually as
Into<String>
) butstr::diff
asks instead for an argument that isInto<Cow<'static, str>>
, which is not satisfied by strings created at runtime. This means I can't do something likeI don't see why this couldn't be made to work, but with the current implementation it's a compile-time error:
Meta
predicates-rs version: 3.0.3
rustc --version --verbose
: