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

Convert delete_all_canonicalised to delete folders as a unit #102

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

emmalexandria
Copy link
Contributor

@emmalexandria emmalexandria commented Mar 11, 2024

Draft to solve #101. Doesn't seem to be handling multiple arguments properly (e.g ignoring second argument)

@emmalexandria
Copy link
Contributor Author

Not quite sure why the Windows test failed, it passed on my system.

@emmalexandria emmalexandria changed the title Convert delete_all_canonicalised to delete folders as a unit (Draft) Convert delete_all_canonicalised to delete folders as a unit Mar 11, 2024
@emmalexandria
Copy link
Contributor Author

Seems like the issue with ignoring the second argument was actually with how I was calling into the function. Now working perfectly fine! I was deleting items individually and calling vec! to create an iterator. Using it as intended (vector of multiple files) works fine.

@emmalexandria emmalexandria changed the title (Draft) Convert delete_all_canonicalised to delete folders as a unit Convert delete_all_canonicalised to delete folders as a unit Mar 11, 2024
Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for figuring this out!

It seems like this was working all the time then, even though I have the feeling I am missing something.

Maybe @ArturKovacs could have a look just to be sure I am not committing an ecosystem-breaking mistake here 😅.

Otherwise, ready to go from my side.

@ArturKovacs
Copy link
Collaborator

I think that the current tests should cover any potential regressions although I'm not sure. Looking at the change it seems fine, but then I don't even remember what these functions do. All things considered I'm okay with merging this.

@emmalexandria
Copy link
Contributor Author

emmalexandria commented Mar 12, 2024

I must say I haven't tested this code in a super robust way. I'm calling into it from an existing project that depends on this crate.

I suppose that does have it's advantages in that my application uses basically all the functionality of this library, and so far I haven't noticed any new issues. I haven't been systematic however.

@ArturKovacs
Copy link
Collaborator

ArturKovacs commented Mar 12, 2024 via email

@Byron
Copy link
Owner

Byron commented Mar 12, 2024

Since I validated that the tests cover this case, I'd think that new new way of doing things will be a general improvement as on Windows there won't be individual items in the trash-bin anymore after deleting a directory.

Thank @ArturKovacs, then it looks like if there was a deeper meaning behind the now changed behaviour, it's lost in the tides of time.

Even though maybe on older Windows versions the new code doesn't work, I think it's fine to assume it will and if there are bug-reports, this new version can be yanked. It's beta-testing with users, essentially… and while writing this I realize it's probably better to declare it a braking change to allow applications to opt-in (while hoping they read the changelog).

@Byron Byron merged commit 146ea03 into Byron:master Mar 12, 2024
4 checks passed
@Byron
Copy link
Owner

Byron commented Mar 12, 2024

The new release can be found here: https://github.com/Byron/trash-rs/releases/tag/v4.0.0 .

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.

None yet

3 participants