-
Notifications
You must be signed in to change notification settings - Fork 407
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
feat: nested selection conflict detection #689
Conversation
Thank you for the PR! Could you also add an Then pub fn insert(&mut self, url: &Url) -> bool {
self.insert_many(&[url], url.parent_url())
} |
Ok, I will try it |
Considering that the paths corresponding to insert_many all have the same parent directory, I didn't use the parent variable. I tried some methods that involved the parent variable, but they were not successful in passing the tests. |
To make the compilation pass, I added contains and get_inner methods. I am unsure if using the BTree inside inner within yazi-fm might lead to inconsistencies between HashMap and BTree. |
The usage of Deref here has taught me a lot. |
I have considered the issue of data overflow. Later, I realized that if the add operation is correct, then the count in the parent can safely be decremented to 0. If overflow occurs, it indicates the possibility of some concurrency-related modifications. At this point, the program should panic. |
…ce of `add_many` method
Hi, I made some little changes, and I believe it's all good now. Thank you very much for contributing to this feature, let me merge it! |
I implemented conflict path detection using HashMap. Using a prefix tree might also be a worthwhile option to consider.
Closes #688