docstr
This crate provides a procedural macro for ergonomically creating multi-line string literals.
It is an alternative to indoc.
[]
= "0.4"
Usage
docstr! takes documentation comments as arguments and converts them into a string
use docstr;
let hello_world_in_c: &'static str = docstr!;
assert_eq!
Composition
docstr! can pass the generated string to any macro:
use docstr;
let age = 21;
let name = "Bob";
let colors = ;
let greeting: String = docstr!;
//^ above expands to: format!("...", colors[1])
assert_eq!;
Injecting arguments before the generated string is also possible.
docstr!;
Expands to:
write!;