Skip to content

Commit

Permalink
fmt: add fn_with_mut_ref_params_keep.vv (#21711)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jun 21, 2024
1 parent b008387 commit 4302f86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions vlib/v/fmt/tests/fn_with_mut_ref_params_keep.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
struct Bar {}

fn in_both_mut_ref(mut arr []&Bar, mut bar &Bar) {
assert bar !in arr
}

fn main() {
mut arr := []&Bar{}
mut bar := Bar{}
in_both_mut_ref(mut &arr, mut &bar)
}
2 changes: 0 additions & 2 deletions vlib/v/tests/in_expression_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ fn test_in_array_of_sumtype() {
// for issue 20268
struct Bar {}

// vfmt off
fn in_both_mut_ref(mut arr []&Bar, mut bar &Bar) {
assert bar !in arr
}
Expand All @@ -341,4 +340,3 @@ fn test_in_both_mut_and_ref() {
mut bar := Bar{}
in_both_mut_ref(mut &arr, mut &bar)
}
// vfmt on

0 comments on commit 4302f86

Please sign in to comment.