do-while
A simple Rust macro for wriing clean 'do-while' loops.
Examples
A standard do-while loop:
let mut x = 0;
do_while!
assert_eq!;
'Do-while-do' loops are also supported, running a block of code before the condition is evaluated and another block after the condition is evaluated. This is useful for things like formatting lists:
let items = vec!;
let mut string = String new;
let mut index: usize = 0;
do_while!
assert_eq!;
Multiple do-while and do-while-do loops can be mixed and matched in the same macro invocation:
let mut x = 0;
let mut y = 0;
let list = vec!;
let mut string = String new;
let mut index: usize = 0;
do_while!
assert_eq!;
assert_eq!;
assert_eq!;