Skip to main content

command_bytes

Macro command_bytes 

Source
command_bytes!() { /* proc-macro */ }
Expand description

Runs the given command and returns its standard output as a &'static [u8].

Produces a compile error if the command fails or of the output is not valid UTF-8.

ยงExample

const MAGIC_NUMBER: &[u8] = compile_time::command_bytes!("echo", "42");

assert_eq!(MAGIC_NUMBER, b"42\n");