clippy fixes

This commit is contained in:
2022-02-22 22:40:45 +01:00
parent ce8435e3dc
commit 1b434f6b30
6 changed files with 34 additions and 43 deletions

View File

@@ -9,20 +9,18 @@ pub fn resolve_includes(script: &mut ast::Script, path: &Path) -> Result<()> {
let script_dir = path.parent().expect("Script path has no parent");
for data in &mut script.data {
for values in &mut data.data {
match values {
ast::DataValues::File {
ref path,
ref mut data,
} => {
let mut full_path = script_dir.to_path_buf();
full_path.push(path);
File::open(&full_path)
.map_err(|e| {
anyhow!("Failed to load data from {}: {}", full_path.display(), e)
})?
.read_to_end(data)?;
}
_ => (),
if let ast::DataValues::File {
ref path,
ref mut data,
} = values
{
let mut full_path = script_dir.to_path_buf();
full_path.push(path);
File::open(&full_path)
.map_err(|e| {
anyhow!("Failed to load data from {}: {}", full_path.display(), e)
})?
.read_to_end(data)?;
}
}
}