From df9313c599a3cc98ec90cf49e9d8d8fb800c7f49 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 12 Feb 2016 21:57:53 +0100 Subject: [PATCH] Add EntryHeader::insert_with_sep() --- libimagstore/src/store.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index bb357dd2..1e289622 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -386,7 +386,11 @@ impl EntryHeader { * Returns true if header field was set, false if there is already a value */ pub fn insert(&mut self, spec: &str, v: Value) -> Result { - let tokens = EntryHeader::tokenize(spec, '.'); + self.insert_with_sep(spec, '.', v) + } + + pub fn insert_with_sep(&mut self, spec: &str, sep: char, v: Value) -> Result { + let tokens = EntryHeader::tokenize(spec, sep); if tokens.is_err() { // return parser error if any return tokens.map(|_| false); }