-
Notifications
You must be signed in to change notification settings - Fork 222
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
Fixed the Event of watch dir Deletion #540
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added some comments, let me know if you want to leave them to me or refactor those parts by yourself.
I added the comment for watches HashMap. |
Co-authored-by: Aron <[email protected]>
Any reason to close it ? I did ask for another thing: The unwrap you're using seems like something that could crash. Otherwise the PR is fine. |
@0xpr03 are there more changes I should do before it gets approved? |
Looks good, I'm just too busy right now and don't wanna rush things. |
notify/src/inotify.rs
Outdated
if path.is_none() { | ||
remove_kind = RemoveKind::Other | ||
} else { | ||
let watched_path = path.clone().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this now: When does this unwrap fail ? Do we need to clone here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
considering it's in else branch which checks for is_none condition, it shouldn't fail on unwrap.
The clone is there coz it needs to be owned by Event but path is in notify.
Huh so apparently github never send my review.. Sorry for that.. |
Resolves #493
Deleting watched dir only returns Delete self and Ignore event. Unlike deleting other folders, it doesn't return events to check whether it is dir or not.
I stored whether path is dir or not in watches. Taking metadata after delete event triggers is not possible.