Fix: Header entry setting

The header was not set properly. This fixes this bug.
This commit is contained in:
Matthias Beyer 2018-02-06 20:39:05 +01:00
parent 346e5a9444
commit 29e88c5de0

View file

@ -17,15 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// //
use std::collections::BTreeMap;
use toml::Value; use toml::Value;
use libimagstore::storeid::IntoStoreId; use libimagstore::storeid::IntoStoreId;
use libimagstore::store::FileLockEntry; use libimagstore::store::FileLockEntry;
use libimagstore::store::Store; use libimagstore::store::Store;
use toml_query::set::TomlValueSetExt; use toml_query::insert::TomlValueInsertExt;
use module_path::ModuleEntryPath; use module_path::ModuleEntryPath;
use error::Result; use error::Result;
@ -56,18 +54,7 @@ impl<'a> NoteStore<'a> for Store {
{ {
let entry = lockentry.deref_mut(); let entry = lockentry.deref_mut();
entry.get_header_mut().insert("note.name", Value::String(name))?;
{
let header = entry.get_header_mut();
let _ = header
.set("note", Value::Table(BTreeMap::new()))
.chain_err(|| NEK::StoreWriteError);
let _ = header
.set("note.name", Value::String(name))
.chain_err(|| NEK::StoreWriteError);
}
*entry.get_content_mut() = text; *entry.get_content_mut() = text;
} }