FileExplorer icon indicating copy to clipboard operation
FileExplorer copied to clipboard

Adds `FileType` enum

Open NatanFreeman opened this issue 2 years ago • 2 comments

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.

NatanFreeman avatar Jul 06 '23 11:07 NatanFreeman

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

phoenix-ru avatar Jul 07 '23 18:07 phoenix-ru

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.

NatanFreeman avatar Jul 08 '23 18:07 NatanFreeman