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

Reduce unneeded complexity (KISS) #2

Closed
cwithmichael opened this issue Apr 20, 2022 · 1 comment
Closed

Reduce unneeded complexity (KISS) #2

cwithmichael opened this issue Apr 20, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@cwithmichael
Copy link
Owner

Improve the code by reducing unnecessary abstractions.
This was pointed out by a user (Plecra) on Reddit

His comment:

My main recommendation would be to reduce your abstractions. The FileType trait isn't necessary - you only need a function that maps file types to headers (&'static [u8]), and another that can check them against a buffer. Other than that, there are a few nice std APIs that can help clean things up - iterator methods, ascii equality, etc.

@cwithmichael cwithmichael added the enhancement New feature or request label Apr 20, 2022
@cwithmichael
Copy link
Owner Author

The FileType trait has been removed. And the code has been improved. I'll leave this open for now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant