Commit 8c2d800 1 parent 65bbd1a commit 8c2d800 Copy full SHA for 8c2d800
File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,17 @@ where
45
45
/// Create a JSON deserializer from one of the possible serde_json input
46
46
/// sources.
47
47
///
48
+ /// When reading from a source against which short reads are not efficient, such
49
+ /// as a [`File`], you will want to apply your own buffering because serde_json
50
+ /// will not buffer the input. See [`std::io::BufReader`].
51
+ ///
48
52
/// Typically it is more convenient to use one of these methods instead:
49
53
///
50
54
/// - Deserializer::from_str
51
55
/// - Deserializer::from_slice
52
56
/// - Deserializer::from_reader
57
+ ///
58
+ /// [`File`]: https://doc.rust-lang.org/std/fs/struct.File.html
53
59
pub fn new ( read : R ) -> Self {
54
60
Deserializer {
55
61
read,
Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ where
191
191
R : io:: Read ,
192
192
{
193
193
/// Create a JSON input source to read from a std::io input stream.
194
+ ///
195
+ /// When reading from a source against which short reads are not efficient, such
196
+ /// as a [`File`], you will want to apply your own buffering because serde_json
197
+ /// will not buffer the input. See [`std::io::BufReader`].
198
+ ///
199
+ /// [`File`]: https://doc.rust-lang.org/std/fs/struct.File.html
194
200
pub fn new ( reader : R ) -> Self {
195
201
IoRead {
196
202
iter : LineColIterator :: new ( reader. bytes ( ) ) ,
You can’t perform that action at this time.
0 commit comments