On Wed, Jul 19, 2023 at 09:09:51AM +0000, Tage Johansson wrote:
+fn test_connect_command() {
+ let nbd = libnbd::Handle::new().unwrap();
+ nbd.connect_command(&[
+ c_str!("nbdkit"),
+ c_str!("-s"),
+ c_str!("--exit-with-parent"),
+ c_str!("-v"),
+ c_str!("null"),
+ ])
+ .unwrap();
So this doesn't seem very natural Rust to me. For example standard
library exec::execvp lets you just use:
let err = exec::execvp("echo", &["echo", "foo"]);
println!("Error: {}", err);
(
https://docs.rs/exec/latest/exec/fn.execvp.html)
Is there a way to get rid of the c_str macro here?
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW