@@ -28,7 +28,8 @@ from_integer! {
28
28
}
29
29
30
30
impl From < f32 > for Value {
31
- /// Convert 32-bit floating point number to `Value`
31
+ /// Convert 32-bit floating point number to `Value::Number`, or
32
+ /// `Value::Null` if infinite or NaN.
32
33
///
33
34
/// # Examples
34
35
///
@@ -44,7 +45,8 @@ impl From<f32> for Value {
44
45
}
45
46
46
47
impl From < f64 > for Value {
47
- /// Convert 64-bit floating point number to `Value`
48
+ /// Convert 64-bit floating point number to `Value::Number`, or
49
+ /// `Value::Null` if infinite or NaN.
48
50
///
49
51
/// # Examples
50
52
///
@@ -60,7 +62,7 @@ impl From<f64> for Value {
60
62
}
61
63
62
64
impl From < bool > for Value {
63
- /// Convert boolean to `Value`
65
+ /// Convert boolean to `Value::Bool`.
64
66
///
65
67
/// # Examples
66
68
///
@@ -76,7 +78,7 @@ impl From<bool> for Value {
76
78
}
77
79
78
80
impl From < String > for Value {
79
- /// Convert `String` to `Value`
81
+ /// Convert `String` to `Value::String`.
80
82
///
81
83
/// # Examples
82
84
///
@@ -92,7 +94,7 @@ impl From<String> for Value {
92
94
}
93
95
94
96
impl From < & str > for Value {
95
- /// Convert string slice to `Value`
97
+ /// Convert string slice to `Value::String`.
96
98
///
97
99
/// # Examples
98
100
///
@@ -108,7 +110,7 @@ impl From<&str> for Value {
108
110
}
109
111
110
112
impl < ' a > From < Cow < ' a , str > > for Value {
111
- /// Convert copy-on-write string to `Value`
113
+ /// Convert copy-on-write string to `Value::String`.
112
114
///
113
115
/// # Examples
114
116
///
@@ -133,7 +135,7 @@ impl<'a> From<Cow<'a, str>> for Value {
133
135
}
134
136
135
137
impl From < Number > for Value {
136
- /// Convert `Number` to `Value`
138
+ /// Convert `Number` to `Value::Number`.
137
139
///
138
140
/// # Examples
139
141
///
@@ -149,7 +151,7 @@ impl From<Number> for Value {
149
151
}
150
152
151
153
impl From < Map < String , Value > > for Value {
152
- /// Convert map (with string keys) to `Value`
154
+ /// Convert map (with string keys) to `Value::Object`.
153
155
///
154
156
/// # Examples
155
157
///
@@ -166,7 +168,7 @@ impl From<Map<String, Value>> for Value {
166
168
}
167
169
168
170
impl < T : Into < Value > > From < Vec < T > > for Value {
169
- /// Convert a `Vec` to `Value`
171
+ /// Convert a `Vec` to `Value::Array`.
170
172
///
171
173
/// # Examples
172
174
///
@@ -182,7 +184,7 @@ impl<T: Into<Value>> From<Vec<T>> for Value {
182
184
}
183
185
184
186
impl < T : Clone + Into < Value > > From < & [ T ] > for Value {
185
- /// Convert a slice to `Value`
187
+ /// Convert a slice to `Value::Array`.
186
188
///
187
189
/// # Examples
188
190
///
@@ -198,7 +200,7 @@ impl<T: Clone + Into<Value>> From<&[T]> for Value {
198
200
}
199
201
200
202
impl < T : Into < Value > > FromIterator < T > for Value {
201
- /// Convert an iterable type to a `Value`
203
+ /// Create a `Value::Array` by collecting an iterator of array elements.
202
204
///
203
205
/// # Examples
204
206
///
@@ -228,7 +230,7 @@ impl<T: Into<Value>> FromIterator<T> for Value {
228
230
}
229
231
230
232
impl < K : Into < String > , V : Into < Value > > FromIterator < ( K , V ) > for Value {
231
- /// Convert an iterable type to a `Value`
233
+ /// Create a `Value::Object` by collecting an iterator of key-value pairs.
232
234
///
233
235
/// # Examples
234
236
///
@@ -248,7 +250,7 @@ impl<K: Into<String>, V: Into<Value>> FromIterator<(K, V)> for Value {
248
250
}
249
251
250
252
impl From < ( ) > for Value {
251
- /// Convert `()` to `Value`
253
+ /// Convert `()` to `Value::Null`.
252
254
///
253
255
/// # Examples
254
256
///
0 commit comments