Skip to content

Conversation

@giraffekey
Copy link
Contributor

@giraffekey giraffekey commented Feb 21, 2025

Adds two simple quality of life functions to FileType and MimeType.

FileType::Mpeg.ext(); // Some("mp3")
MimeType::Jpeg.ext(); // Some("jpg")

My use case is that I want to extract the pictures and save them separately to disk, so this saves me a manual pattern match on the extension of the file.

Copy link
Owner

@Serial-ATA Serial-ATA left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I think having this on MimeType is fine, but it probably shouldn't be on FileType.

@giraffekey
Copy link
Contributor Author

Makes sense.

@Serial-ATA
Copy link
Owner

Thanks!

@Serial-ATA Serial-ATA merged commit a438022 into Serial-ATA:main Feb 23, 2025
4 checks passed
@Serial-ATA Serial-ATA added this to the 0.22.3 milestone Apr 4, 2025
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.

2 participants