October 2019
Intermediate to advanced
444 pages
10h 37m
English
You are only a few steps from creating macros:
// A simple macro without argumentsmacro_rules! one_plus_one { () => { 1 + 1 };}
fn main() { println!("1 + 1 = {}", one_plus_one!());}
// A simple pattern matching argumentmacro_rules! one_and_one { (plus) => { 1 + 1 }; (minus) => { 1 - 1 }; (mult) ...Read now
Unlock full access