Compare commits

..

2 commits

Author SHA1 Message Date
6d55b3c309
removed an unecessary allocation
Some checks failed
continuous-integration/drone/push Build is failing
you know what they say, premature optimisation is the best optimisation
2021-03-12 02:55:40 +10:00
b09b871b3d
...how did i not notice this earlier 2021-03-07 17:01:27 +10:00
2 changed files with 2 additions and 3 deletions

View file

@ -1,7 +1,6 @@
use std::path::PathBuf;
use mime_guess::Mime;
use smartstring::alias::String;
use crate::inspectors::mime_extension_lookup;
@ -16,7 +15,7 @@ pub struct Findings {
}
impl Findings {
pub fn recommended_extension(&self) -> Option<String> {
mime_extension_lookup(self.mime.clone()).map(|extensions| extensions[0].to_owned())
pub fn recommended_extension(&self) -> Option<&str> {
mime_extension_lookup(self.mime.clone()).map(|extensions| &*extensions[0])
}
}