The with
macro
This is a macro that takes an object and lets you call methods on that object without naming it.
The first argument is an expression that will be assigned to a variable in let binding. To make
that binding mutable, prepend mut
to the expression.
Calling a function that starts with a .
will be converted into a method call using this
variable.
The supported forms are:
.method(args..)
let pat = .method(args..);
var = .method(args..);
Anything else will be evaluated unmodified as an expression.
Usage
use with;
let vec = with! ;
assert_eq!;