BurntSushi/quickcheck

Add support for mut bindings in function arguments

開放

#269 建立於 2021年1月12日

 (7 則留言) (0 個反應) (0 位負責人)Rust (161 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (2,763 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I noticed that this works:

fn check_int_slices(v: HashSet<u64>, lens: Vec<usize>) -> bool {
    let mut lens = lens;
    ...
}

but this doesn't:

fn check_int_slices(v: HashSet<u64>, mut lens: Vec<usize>) -> bool {
    ...
}

Error:

error: no rules expected the token `lens`
   --> src/lib.rs:797:50
    |
797 |         fn check_int_slices(v: HashSet<u64>, mut lens: Vec<usize>) -> bool {
    |                                                  ^^^^ no rules expected this token in macro call

貢獻者指南