summaryrefslogtreecommitdiff
path: root/src/resource.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-01-09 14:49:36 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-01-09 14:49:36 +0000
commit9d5758cd7b6bf63c83232fc0a71ae906a2be9c8b (patch)
treeb78f4304820009b17c4c1a35df7b364e4667e4c4 /src/resource.rs
parent41e1968d4f546360c3f19b87a311cd7f6b8ebadc (diff)
downloadsubplot-9d5758cd7b6bf63c83232fc0a71ae906a2be9c8b.tar.gz
chore: Simplify to use resource::read_as_string
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/resource.rs')
-rw-r--r--src/resource.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resource.rs b/src/resource.rs
index 15a239e..f34d806 100644
--- a/src/resource.rs
+++ b/src/resource.rs
@@ -19,7 +19,7 @@ pub fn open<P: AsRef<Path>>(subpath: P) -> io::Result<Box<impl Read>> {
/// falling back to potentially embedded file content
pub fn read_as_string<P: AsRef<Path>>(subpath: P) -> io::Result<String> {
let mut f = open(subpath)?;
- let mut ret = String::new();
+ let mut ret = String::with_capacity(8192);
f.read_to_string(&mut ret)?;
Ok(ret)
}