Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rmp-serde/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased][unreleased]
## 0.13.0 - 2017-04-24
### Added
- Zero-copy deserialization from `&[u8]`.

Expand Down
14 changes: 14 additions & 0 deletions rmp-serde/tests/decode_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,17 @@ fn pass_enum_with_one_arg() {
assert_eq!(Enum::V1(vec![1, 2]), actual);
assert_eq!(buf.len() as u64, de.get_ref().position())
}

#[test]
fn pass_from_slice() {
let buf = [0x93, 0xa4, 0x4a, 0x6f, 0x68, 0x6e, 0xa5, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x2a];

#[derive(Debug, PartialEq, Deserialize)]
struct Person<'a> {
name: &'a str,
surname: &'a str,
age: u8,
}

assert_eq!(Person { name: "John", surname: "Smith", age: 42 }, rmps::from_slice(&buf[..]).unwrap());
}
1 change: 1 addition & 0 deletions rmp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
## 0.8.6 - 2017-04-23
### Added
- New `rmp::decode::read_str_from_slice` function for zero-copy reading strings from slices.

Expand Down
2 changes: 1 addition & 1 deletion rmp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rmp"
version = "0.8.5"
version = "0.8.6"
authors = ["Evgeny Safronov <division494@gmail.com>"]
license = "MIT"
description = "Pure Rust MessagePack serialization implementation"
Expand Down
8 changes: 8 additions & 0 deletions rmpv-tests/tests/de_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,11 @@ fn pass_enum_from_value() {
assert_eq!(Enum::Struct { name: "John", age: 42 },
deserialize_from(ValueRef::Array(vec![ValueRef::from(3), ValueRef::Array(vec![ValueRef::from("John"), ValueRef::from(42)])])).unwrap());
}

#[test]
fn pass_from_slice() {
let buf = [0x93, 0xa4, 0x4a, 0x6f, 0x68, 0x6e, 0xa5, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x2a];

assert_eq!(ValueRef::Array(vec![ValueRef::from("John"), ValueRef::from("Smith"), ValueRef::from(42)]),
rmps::from_slice(&buf[..]).unwrap());
}
6 changes: 4 additions & 2 deletions rmpv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
## 0.4.0 - 2017-04-24
### Added
- Implement `Deserialize` for `ValueRef`.
- Implement `Deserializer` for `ValueRef`.
- Implement `Deserialize` for `ValueRef<'de>`.
- Implement `Deserializer` for `ValueRef<'de>`.
- Implement `Deserializer` for `&'de ValueRef<'de>`.
- Zero-copy deserialization from `ValueRef`.

### Changed
Expand Down
Loading