Make read_resource_file param simpler and more idiomatic.

`<P: AsRef<Path>>` is also what `File::open` uses as a generic type for
the parameter.
This commit is contained in:
Corey Farwell 2016-04-16 23:06:59 -04:00
parent 15e76eb6e2
commit c37ab1facd
3 changed files with 6 additions and 8 deletions

View file

@ -112,7 +112,7 @@ impl HSTSList {
}
pub fn preload_hsts_domains() -> Option<HSTSList> {
read_resource_file(&["hsts_preload.json"]).ok().and_then(|bytes| {
read_resource_file("hsts_preload.json").ok().and_then(|bytes| {
from_utf8(&bytes).ok().and_then(|hsts_preload_content| {
HSTSList::new_from_preload(hsts_preload_content)
})