diff options
author | White-Oak <lpzhelud@gmail.com> | 2016-10-12 11:44:30 +0300 |
---|---|---|
committer | White-Oak <lpzhelud@gmail.com> | 2016-10-12 11:47:46 +0300 |
commit | 69d1bbb70b7db29f5d0bbaa972476da9fd000d64 (patch) | |
tree | 3e31848354bc92a522045827b933b078883f7457 /src/schema/value.rs | |
parent | 1435327ad1217b4a7c9406fb33fb7b4c81a297c3 (diff) |
Added a macro to define document simply
Added a test to cover that.
Added `impl From<&str> for Value` for dco macro usage.
Diffstat (limited to 'src/schema/value.rs')
-rw-r--r-- | src/schema/value.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/schema/value.rs b/src/schema/value.rs index 36f21bc..084b8d3 100644 --- a/src/schema/value.rs +++ b/src/schema/value.rs @@ -59,6 +59,11 @@ impl From<u32> for Value { } } +impl<'a> From<&'a str> for Value { + fn from(s: &'a str) -> Value { + Value::Str(s.to_string()) + } +} const TEXT_CODE: u8 = 0; const U32_CODE: u8 = 1; @@ -95,4 +100,4 @@ impl BinarySerializable for Value { } } } -}
\ No newline at end of file +} |