[go: up one dir, main page]

ron 0.6.1

Rusty Object Notation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
struct Borrowed<'a> {
    value: &'a str,
}

const BORROWED: &str = "Borrowed(value: \"test\")";

#[test]
fn borrowed_str() {
    assert_eq!(
        ron::de::from_str(BORROWED).ok(),
        Some(Borrowed { value: "test" })
    );
}