Macro velcro::map_iter_from

source ·
map_iter_from!() { /* proc-macro */ }
Expand description

Creates an iterator over pairs of values in the same way as map_iter except that values are converted into the expected type using an Into implementation.

Usage

use velcro::map_iter_from;

assert_eq!(
    map_iter_from! {
        0: "a",
        1: "b",
        ..(2..=5): "c"
    }.collect::<Vec<(i64, String)>>(),
    vec![
        (0, String::from("a")),
        (1, String::from("b")),
        (2, String::from("c")),
        (3, String::from("c")),
        (4, String::from("c")),
        (5, String::from("c"))
    ]);