Skip to content

v2.0

Choose a tag to compare

@Natural-selection1 Natural-selection1 released this 10 Apr 02:55
· 21 commits to master since this release

新增:
* 可以使用块在返回之前执行其他代码

示例

use better_comprehension::vector;
let vec_1 = vec!["123".to_string(), "456".to_string()];
let vec_2 = vec!["abc".to_string(), "def".to_string()];
let vec = vector![
    {
        let some = x.clone() + y;
        println!("{}", some);

        (x.clone(), y.clone())
    }
    for x in vec_1 if x.contains("1")
    for y in vec_2 if y.contains("d")
];