From c86f7909861105d1b35e69c5d7bff953e87a41be Mon Sep 17 00:00:00 2001 From: awiouy Date: Fri, 9 Feb 2018 21:18:06 +0100 Subject: [PATCH] core API: from_file, from_reader --- core/src/authentication.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/authentication.rs b/core/src/authentication.rs index 0075fe0d..4e6cc262 100644 --- a/core/src/authentication.rs +++ b/core/src/authentication.rs @@ -121,14 +121,14 @@ impl Credentials { } } - pub fn from_reader(mut reader: R) -> Credentials { + fn from_reader(mut reader: R) -> Credentials { let mut contents = String::new(); reader.read_to_string(&mut contents).unwrap(); serde_json::from_str(&contents).unwrap() } - pub fn from_file>(path: P) -> Option { + pub(crate) fn from_file>(path: P) -> Option { File::open(path).ok().map(Credentials::from_reader) }