Skip to main content

potato_type/common/
mod.rs

1use std::collections::HashSet;
2use std::sync::OnceLock;
3
4pub(crate) fn get_image_media_types() -> &'static HashSet<&'static str> {
5    static IMAGE_MEDIA_TYPES: OnceLock<HashSet<&'static str>> = OnceLock::new();
6    IMAGE_MEDIA_TYPES.get_or_init(|| {
7        let mut set = HashSet::new();
8        set.insert("image/jpeg");
9        set.insert("image/png");
10        set.insert("image/gif");
11        set.insert("image/webp");
12        set
13    })
14}