diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-01-09 14:49:36 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-01-09 14:49:36 +0000 |
commit | 9d5758cd7b6bf63c83232fc0a71ae906a2be9c8b (patch) | |
tree | b78f4304820009b17c4c1a35df7b364e4667e4c4 /src/bindings.rs | |
parent | 41e1968d4f546360c3f19b87a311cd7f6b8ebadc (diff) | |
download | subplot-9d5758cd7b6bf63c83232fc0a71ae906a2be9c8b.tar.gz |
chore: Simplify to use resource::read_as_string
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/bindings.rs')
-rw-r--r-- | src/bindings.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bindings.rs b/src/bindings.rs index 273a84f..fe26690 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -9,7 +9,6 @@ use serde_aux::prelude::*; use std::collections::HashMap; use std::convert::identity; -use std::io::Read; use std::path::Path; use std::str::FromStr; @@ -507,10 +506,8 @@ impl Bindings { where P: AsRef<Path>, { - let mut f = resource::open(filename.as_ref()) + let yaml = resource::read_as_string(filename.as_ref()) .map_err(|e| SubplotError::BindingsFileNotFound(filename.as_ref().into(), e))?; - let mut yaml = String::new(); - f.read_to_string(&mut yaml)?; self.add_from_yaml(&yaml)?; Ok(()) } |