diff --git a/src/adapters/custom.rs b/src/adapters/custom.rs index 9d15557..e02f979 100644 --- a/src/adapters/custom.rs +++ b/src/adapters/custom.rs @@ -50,103 +50,32 @@ impl Default for CustomIdentifiers { fn default() -> CustomIdentifiers { CustomIdentifiers { ffmpeg: CustomIdentifier { - extensions: Some( - ffmpeg::EXTENSIONS - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - ffmpeg::MIMETYPES - .to_vec() - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(ffmpeg::EXTENSIONS)), + mimetypes: Some(strs(ffmpeg::MIMETYPES)), }, gz: CustomIdentifier { - extensions: Some( - decompress::EXTENSIONS_GZ - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - decompress::MIMETYPES_GZ - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(decompress::EXTENSIONS_GZ)), + mimetypes: Some(strs(decompress::MIMETYPES_GZ)), }, bz2: CustomIdentifier { - extensions: Some( - decompress::EXTENSIONS_BZ2 - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - decompress::MIMETYPES_BZ2 - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(decompress::EXTENSIONS_BZ2)), + mimetypes: Some(strs(decompress::MIMETYPES_BZ2)), }, xz: CustomIdentifier { - extensions: Some( - decompress::EXTENSIONS_XZ - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - decompress::MIMETYPES_XZ - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(decompress::EXTENSIONS_XZ)), + mimetypes: Some(strs(decompress::MIMETYPES_XZ)), }, zst: CustomIdentifier { - extensions: Some( - decompress::EXTENSIONS_ZST - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - decompress::MIMETYPES_ZST - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(decompress::EXTENSIONS_ZST)), + mimetypes: Some(strs(decompress::MIMETYPES_ZST)), }, zip: CustomIdentifier { - extensions: Some( - zip::EXTENSIONS - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - zip::MIMETYPES - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(zip::EXTENSIONS)), + mimetypes: Some(strs(zip::MIMETYPES)), }, mbox: CustomIdentifier { - extensions: Some( - mbox::EXTENSIONS - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), - mimetypes: Some( - mbox::MIMETYPES - .iter() - .map(|&s| s.to_string()) - .collect::>(), - ), + extensions: Some(strs(mbox::EXTENSIONS)), + mimetypes: Some(strs(mbox::MIMETYPES)), }, } }