diff options
author | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-01-15 18:18:56 +0100 |
---|---|---|
committer | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-01-15 18:19:36 +0100 |
commit | 1697fc0ecfd86d770deb7a9824bd8f2376606313 (patch) | |
tree | e81fcdca3b7e18babd5b16de3dbc56e52d74997d | |
parent | 1758605f7b25fa125c7a2a6b5c5cc94b9f5849fa (diff) |
Add convenience method for quickly creating props
-rw-r--r-- | src/vobject/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vobject/lib.rs b/src/vobject/lib.rs index fa28c7f..d5ff1ed 100644 --- a/src/vobject/lib.rs +++ b/src/vobject/lib.rs @@ -30,6 +30,11 @@ impl Property { } } + /// Create property from unescaped string. + pub fn new_from_string(s: &str) -> Property { + Property::new(HashMap::new(), escape_chars(s), None) + } + /// Get value as unescaped string. pub fn value_as_string(&self) -> String { unescape_chars(self.raw_value.as_slice()) |