mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
15e76eb6e2
commit
c37ab1facd
3 changed files with 6 additions and 8 deletions
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue