Skip to content

Commit

Permalink
docs: better array_concat docs
Browse files Browse the repository at this point in the history
  • Loading branch information
olehmisar committed Sep 17, 2024
1 parent 663844d commit a2ed448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ fn to_hex_string_bytes(value: Field) -> [u8; 64]
Concatenates two arrays.

```rs
fn array_concat<T, let L1: u32, let L2: u32, let L: u32>(a: [T; L1], b: [T; L2]) -> [T; L]
use nodash::array_concat;

assert(array_concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]);
```
5 changes: 1 addition & 4 deletions src/lib.nr
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ mod array_concat_tests {

#[test]
fn test_simple() {
let a: [u8; 3] = [1, 2, 3];
let b: [u8; 2] = [4, 5];
let c: [u8; 5] = array_concat(a, b);
assert(c == [1, 2, 3, 4, 5]);
assert(array_concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]);
}
}

0 comments on commit a2ed448

Please sign in to comment.