From a2ed44856e20b59373684941be66450422694c8f Mon Sep 17 00:00:00 2001 From: Oleh Misarosh Date: Tue, 17 Sep 2024 08:46:15 +0200 Subject: [PATCH] docs: better array_concat docs --- README.md | 4 +++- src/lib.nr | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b7d823e..804b394 100644 --- a/README.md +++ b/README.md @@ -73,5 +73,7 @@ fn to_hex_string_bytes(value: Field) -> [u8; 64] Concatenates two arrays. ```rs -fn array_concat(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]); ``` diff --git a/src/lib.nr b/src/lib.nr index b84a382..c0ede4b 100644 --- a/src/lib.nr +++ b/src/lib.nr @@ -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]); } }