use crate::{Error, Read, Result, Url};
use std::fs::File;
pub fn open<'a, 'b>(url: &'a Url<'b>) -> Result<Box<dyn Read>> {
let path = url
.to_path()
.ok_or_else(|| Error::InvalidFileUrl(url.to_string()))?;
let file = File::open(path)?;
Ok(Box::new(file))
}