Function tree_magic_mini::match_file
source · pub fn match_file(mimetype: &str, file: &File) -> bool
Expand description
Check if the given file matches the given MIME type.
Examples
use std::fs::File;
// Get path to a GIF file
let file = File::open("tests/image/gif").unwrap();
// Check if the MIME and the file are a match
let result = tree_magic_mini::match_file("image/gif", &file);
assert_eq!(result, true);