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

Adds FileType enum #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Adds FileType enum #63

wants to merge 2 commits into from

Conversation

NatanFreeman
Copy link

This pull request replaces the constants DIRECTORY and FILE inside src-tauri/src/filesystem/mod.rs with an enum called FileType as suggested here #60. This is makes the code more idiomatic and improves efficiency as we are no longer storing an entire str in memory.

@phoenix-ru
Copy link

Your implementation doesn't actually differ from the string comparison in terms of efficiency, because Serde's Serialize/Deserialize uses strings, but not numbers.
I suggest you follow the initial recommendation and add serde_repr

@NatanFreeman
Copy link
Author

Your implementation doesn't actually differ from the string comparison in terms of efficiency, because Serde's Serialize/Deserialize uses strings, but not numbers. I suggest you follow the initial recommendation and add serde_repr

Thanks for the suggestion. The recent commit should implement it.

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.

3 participants