removed an unecessary allocation
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
you know what they say, premature optimisation is the best optimisation
This commit is contained in:
parent
b09b871b3d
commit
6d55b3c309
2 changed files with 6 additions and 3 deletions
4
rustfmt.toml
Normal file
4
rustfmt.toml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
max_width = 120
|
||||||
|
hard_tabs = true
|
||||||
|
tab_spaces = 2
|
||||||
|
newline_style = "Unix"
|
|
@ -1,7 +1,6 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use mime_guess::Mime;
|
use mime_guess::Mime;
|
||||||
use smartstring::alias::String;
|
|
||||||
|
|
||||||
use crate::inspectors::mime_extension_lookup;
|
use crate::inspectors::mime_extension_lookup;
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ pub struct Findings {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Findings {
|
impl Findings {
|
||||||
pub fn recommended_extension(&self) -> Option<String> {
|
pub fn recommended_extension(&self) -> Option<&str> {
|
||||||
mime_extension_lookup(self.mime.clone()).map(|extensions| extensions[0].to_owned())
|
mime_extension_lookup(self.mime.clone()).map(|extensions| &*extensions[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue