Skip to content

Conversation

@erickt
Copy link
Contributor

@erickt erickt commented Mar 5, 2019

Rewrite find files in O(lg(n)), and clean up the api …
This PR makes some large changes to the library, in order to
reduce finding a file from O(n) to O(lg(n)), by maintaining
the directory entries in a sorted order, and binary searching
for a file.

In order to accomplish this, I changed how directories
work. Instead of each directory supporting the ability to look
up a path relative to the root directory, I instead introduce
a FileSystem that is the entrypoint for resolving a path into
contents. This is more analogous to how std::fs operates.

erickt added 7 commits March 1, 2019 23:34
The interface include_dir exposes hasn't changed, so I've only
done a minor bump to 0.2.2, but include_dir_impl now exports
`include_dir`, so I've given it a major bump.

It also raises the minimum tested version to rust 1.31.0, the
first version that added support for editions.
Not all operating systems guarantee that paths can be converted
to unicode. So to be safe, this PR panics instead of silently
replacing invalid unicode characters with the unicode replacement
character.
This PR makes some large changes to the library, in order to
reduce finding a file from O(n) to O(lg(n)), by maintaining
the directory entries in a sorted order, and binary searching
for a file.

In order to accomplish this, I changed how directories
work. Instead of each directory supporting the ability to look
up a path relative to the root directory, I instead introduce
a `FileSystem` that is the entrypoint for resolving a path into
contents. This is more analogous to how std::fs operates.
@Michael-F-Bryan
Copy link
Owner

@erickt, how would this interact with #36 and #35?

Sorry it's been a while, I was quite busy with work when the original PRs were made and never came back to reviewing/merging them 😞

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

Successfully merging this pull request may close these issues.

2 participants