Commit c51185c
authored
Add missing
<!-- Please refer to our CONTRIBUTING documentation for any questions on
submitting a pull request. -->
<!-- Provide a general summary of your changes in the Title above. -->
## Description
This PR aims to add an `index_of()` fn to `IMT` impl to mirror the TS
implementation. The function takes a `leaf` and returns an
`Option<usize>` that evaluate to `Some(idx)` where `idx` is the index of
the `leaf` or `None` when the `leaf` does not exists in the `IMT`.
<!-- Describe your changes in detail. -->
<!-- You may want to answer some of the following questions: -->
<!-- What kind of change does this PR introduce?** (Bug fix, feature,
docs update, ...) -->
<!-- What is the current behavior?** (You can also link to an open issue
here) -->
<!-- What is the new behavior (if this is a feature change)? -->
<!-- Does this PR introduce a breaking change?** (What changes might
users need to make in their application due to this PR?) -->
## Checklist
<!-- Please check if the PR fulfills these requirements. -->
- [x] I have read and understand the [contributor
guidelines](https://github.com/privacy-scaling-explorations/zk-kit.rust/blob/main/CONTRIBUTING.md)
and [code of
conduct](https://github.com/privacy-scaling-explorations/zk-kit.rust/blob/main/CODE_OF_CONDUCT.md).
- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I have run `yarn style` without getting any errors
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
> [!IMPORTANT]
> We do not accept minor grammatical fixes (e.g., correcting typos,
rewording sentences) unless they significantly improve clarity in
technical documentation. These contributions, while appreciated, are not
a priority for merging. If there is a grammatical mistake, please feel
free to message the team.index_of() fn (#67)1 parent 1d475e4 commit c51185c
1 file changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
325 | 346 | | |
0 commit comments