From b77a373efa5170a73aaf5bc12f33771154cd0a6a Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 17 May 2018 15:08:38 +0300 Subject: [PATCH] Opml: remvoe uneccesary to_string invocation. --- hammond-data/src/opml.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hammond-data/src/opml.rs b/hammond-data/src/opml.rs index 618c290..20ebfc8 100644 --- a/hammond-data/src/opml.rs +++ b/hammond-data/src/opml.rs @@ -52,8 +52,8 @@ pub fn import_to_db(reader: R) -> Result, reader::Error> { /// return the new `Source`s // TODO: Write test pub fn import_from_file>(path: P) -> Result, DataError> { - let content = fs::read_to_string(path)?; - import_to_db(content.as_bytes()).map_err(From::from) + let content = fs::read(path)?; + import_to_db(content.as_slice()).map_err(From::from) } /// Extracts the `outline` elemnts from a reader `R` and returns a `HashSet` of `Opml` structs.