Fix file path as_ref usage

This commit is contained in:
Raamakrishnan 2020-02-20 21:50:19 +05:30
parent 2972aa9b10
commit 9d90e78644

View file

@ -59,6 +59,7 @@ impl Filelist {
/// Returns an error if the filelist in `path` cannot be read. Also returns /// Returns an error if the filelist in `path` cannot be read. Also returns
/// error if any of the nested filelists cannot be read. /// error if any of the nested filelists cannot be read.
pub fn parse_file(path: impl AsRef<Path>) -> Result<Filelist, Box<dyn Error>> { pub fn parse_file(path: impl AsRef<Path>) -> Result<Filelist, Box<dyn Error>> {
let path = path.as_ref();
let contents = fs::read_to_string(path)?; let contents = fs::read_to_string(path)?;
let mut filelist = Filelist::new(); let mut filelist = Filelist::new();