Skip to content

Commit

Permalink
fix: Fix some mistakes in arithmetic generics docs (#5999)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
jfecher authored Sep 11, 2024
1 parent 19f5757 commit 29550d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/docs/noir/concepts/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl<T, U, let N: u32, let M: u32> Serialize<N + M> for (T, U)

fn main() {
let data = (1, [2, 3, 4]);
assert(data.serialize().len(), 4);
assert_eq(data.serialize().len(), 4);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn seems_fine<let N: u32>(array: [Field; N]) -> [Field; N] {

fn pop<let N: u32>(array: [Field; N]) -> [Field; N - 1] {
let mut result: [Field; N - 1] = std::mem::zeroed();
for i in 0..N {
for i in 0..N - 1 {
result[i] = array[i];
}
result
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// docs:start:underflow-example
fn pop<let N: u32>(array: [Field; N]) -> [Field; N - 1] {
let mut result: [Field; N - 1] = std::mem::zeroed();
for i in 0..N {
for i in 0..N - 1 {
result[i] = array[i];
}
result
Expand Down

0 comments on commit 29550d1

Please sign in to comment.