config/datastore.rs - open file for reading

This commit is contained in:
Dietmar Maurer 2018-12-09 10:22:39 +01:00
parent 926fc18687
commit 6349ed60b4

View File

@ -38,6 +38,7 @@ pub fn config() -> Result<SectionConfigData, Error> {
let mut file = match OpenOptions::new()
.create(true)
.read(true)
.write(true)
.open(DATASTORE_CFG_FILENAME) {
Ok(file) => file,
@ -46,7 +47,7 @@ pub fn config() -> Result<SectionConfigData, Error> {
};
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
file.read_to_string(&mut contents)?;
CONFIG.parse(DATASTORE_CFG_FILENAME, &contents)
}