Skip to content

Use flat-tree interator #12

Open
Open
@yoshuawuyts

Description

@yoshuawuyts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions