Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use flat-tree interator #12

Open
yoshuawuyts opened this issue Nov 13, 2018 · 0 comments
Open

Use flat-tree interator #12

yoshuawuyts opened this issue Nov 13, 2018 · 0 comments

Comments

@yoshuawuyts
Copy link
Contributor

Feature Request

Summary

tree-index is currently the only module using flat-tree's with_depth_* range of methods. We could refactor this module to use the (stateful) flat-tree iterator in order to get rid of exposing the methods.

Motivation

Flat tree's with_depth methods are hard to get right, and the less API surface we can expose the better it is.

Expected Behavior

Replace this with iterator code: https://github.com/datrs/tree-index/blob/master/src/lib.rs#L185-L210.

Drawbacks

It's a refactor, and it might take a bit of time to get right. Maybe we should work on more tests first?

Rationale and alternatives

The code is pretty magicky as is; we can do better.

Unresolved Questions

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant