INNER CODE UNIT · Rust
cmd_out
str4d/rage · rage/build.rs:110
fn cmd_out(mut self, cmd: &'static str, output: Vec<String>) -> Self {
self.commands.push(ExampleCommand { cmd, output });
self
}
}
struct Examples<const N: usize>([Example; N]);
impl<const N: usize> Examples<N> {
fn render(self, w: &mut impl io::Write) -> io::Result<()> {
let mut roff = Roff::default();
roff.control("SH", [fl!("man-examples-heading").as_str()]);
for example in self.0 {
roff.control("TP", []);
roff.text(
[
Inline::Roman(format!("{}:", example.text)),
Inline::LineBreak,