Macro code_spells::accio

source ·
macro_rules! accio {
    ($x:expr) => { ... };
}
Expand description

Alias for dereferencing. This does not use the Deref or DerefMut traits, but prepends * to the start of the given expression.

Example

let x = 5;
let y = &x;
assert_eq!(accio!(y), x);

let a = vec![0; 5];
assert_eq!(accio!(a.get(0).unwrap()), 0);