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

Add source management capabilities #9

Closed
zbraniecki opened this issue Jan 19, 2021 · 1 comment
Closed

Add source management capabilities #9

zbraniecki opened this issue Jan 19, 2021 · 1 comment

Comments

@zbraniecki
Copy link
Contributor

At the moment FileSource list is stored in RefCell<ChunkyVec<>> in https://github.com/zbraniecki/l10nregistry-rs/blob/master/src/registry/mod.rs#L25

This makes it hard to remove sources, and clear sources, even if we allow for updating sources: djg/chunky-vec#2

We need to decide what to do here. @djg 's suggestion is to use RefCell<ChunkyVec<Option<FileSource>>> and if the source is to be removed, just replacing the value with None.

This may complicate the code in several ways as we'll have to iterate over increasing matrix of permutations of resource/source as sources are added/removed. The loopback on them will be fast (source missing -> invalid candidate), but the logic around it is becoming non-trivial.
It also becomes more problematic when we want to consider #8 because then a missing file may indicate a missing source, or a present source with a missing file, and should impact candidate viability differently.

I'd like to see if there's any other way to approach it, even performance-suboptimal.

@djg @Manishearth - do you think that Option<FileSource> is the only possibility here?

@Manishearth
Copy link

I think you will want to do either this or use slab

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 a pull request may close this issue.

2 participants