summaryrefslogtreecommitdiff
path: root/src/bindings.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-01-09 14:40:01 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-01-09 14:40:01 +0000
commit41e1968d4f546360c3f19b87a311cd7f6b8ebadc (patch)
tree1242c7cc8fb7aeab7dab0455859e2ebc982a5e20 /src/bindings.rs
parent8a1a3baba5f7c7bc42de3b67a021cdb9fb8e1bbc (diff)
downloadsubplot-41e1968d4f546360c3f19b87a311cd7f6b8ebadc.tar.gz
resource: Step one of VFS support, redirect all opens
This redirects all file reading via the new resource module which will be used to control where files come from. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/bindings.rs')
-rw-r--r--src/bindings.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bindings.rs b/src/bindings.rs
index 5f5bece..273a84f 100644
--- a/src/bindings.rs
+++ b/src/bindings.rs
@@ -2,14 +2,13 @@ use super::MatchedStep;
use super::PartialStep;
use super::ScenarioStep;
use super::StepKind;
-use crate::{Result, SubplotError};
+use crate::{resource, Result, SubplotError};
use serde::{Deserialize, Serialize};
use serde_aux::prelude::*;
use std::collections::HashMap;
use std::convert::identity;
-use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::str::FromStr;
@@ -508,7 +507,7 @@ impl Bindings {
where
P: AsRef<Path>,
{
- let mut f = File::open(filename.as_ref())
+ let mut f = resource::open(filename.as_ref())
.map_err(|e| SubplotError::BindingsFileNotFound(filename.as_ref().into(), e))?;
let mut yaml = String::new();
f.read_to_string(&mut yaml)?;