diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-03-21 18:53:53 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-03-26 16:43:33 +0100 |
commit | 8213b6c08ff1c7c88780c2a66b89f26b15763852 (patch) | |
tree | 809224b38b116275e457aadb3691ff844b066c76 /libimagnotes/src | |
parent | 97ac047df54b7235d3356336dea68442e0215f9a (diff) |
lib: Add missing setting of text content
Diffstat (limited to 'libimagnotes/src')
-rw-r--r-- | libimagnotes/src/note.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libimagnotes/src/note.rs b/libimagnotes/src/note.rs index bef74ed9..84c7542e 100644 --- a/libimagnotes/src/note.rs +++ b/libimagnotes/src/note.rs @@ -36,16 +36,23 @@ impl<'a> Note<'a> { { let mut entry = lockentry.deref_mut(); - let mut header = entry.get_header_mut(); - let setres = header.set("note", Value::Table(BTreeMap::new())); - if setres.is_err() { - return Err(NE::new(NEK::StoreWriteError, Some(Box::new(setres.err().unwrap())))); - } - let setres = header.set("note.name", Value::String(name)); - if setres.is_err() { - return Err(NE::new(NEK::StoreWriteError, Some(Box::new(setres.err().unwrap())))); + { + let mut header = entry.get_header_mut(); + let setres = header.set("note", Value::Table(BTreeMap::new())); + if setres.is_err() { + let kind = NEK::StoreWriteError; + return Err(NE::new(kind, Some(Box::new(setres.err().unwrap())))); + } + + let setres = header.set("note.name", Value::String(name)); + if setres.is_err() { + let kind = NEK::StoreWriteError; + return Err(NE::new(kind, Some(Box::new(setres.err().unwrap())))); + } } + + *entry.get_content_mut() = text; } lockentry |