Skip to content

Commit 136b773

Browse files
authored
Merge pull request #1025 from dtolnay/io
Standardize on "I/O" instead of "IO"
2 parents 6fda385 + 207a57b commit 136b773

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,9 +2408,9 @@ where
24082408
Ok(value)
24092409
}
24102410

2411-
/// Deserialize an instance of type `T` from an IO stream of JSON.
2411+
/// Deserialize an instance of type `T` from an I/O stream of JSON.
24122412
///
2413-
/// The content of the IO stream is deserialized directly from the stream
2413+
/// The content of the I/O stream is deserialized directly from the stream
24142414
/// without being buffered in memory by serde_json.
24152415
///
24162416
/// When reading from a source against which short reads are not efficient, such

src/error.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ impl Error {
3636
/// The first character in the input and any characters immediately
3737
/// following a newline character are in column 1.
3838
///
39-
/// Note that errors may occur in column 0, for example if a read from an IO
40-
/// stream fails immediately following a previously read newline character.
39+
/// Note that errors may occur in column 0, for example if a read from an
40+
/// I/O stream fails immediately following a previously read newline
41+
/// character.
4142
pub fn column(&self) -> usize {
4243
self.err.column
4344
}
4445

4546
/// Categorizes the cause of this error.
4647
///
47-
/// - `Category::Io` - failure to read or write bytes on an IO stream
48+
/// - `Category::Io` - failure to read or write bytes on an I/O stream
4849
/// - `Category::Syntax` - input that is not syntactically valid JSON
4950
/// - `Category::Data` - input data that is semantically incorrect
5051
/// - `Category::Eof` - unexpected end of the input data
@@ -76,7 +77,7 @@ impl Error {
7677
}
7778

7879
/// Returns true if this error was caused by a failure to read or write
79-
/// bytes on an IO stream.
80+
/// bytes on an I/O stream.
8081
pub fn is_io(&self) -> bool {
8182
self.classify() == Category::Io
8283
}
@@ -109,7 +110,7 @@ impl Error {
109110
/// Categorizes the cause of a `serde_json::Error`.
110111
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
111112
pub enum Category {
112-
/// The error was caused by a failure to read or write bytes on an IO
113+
/// The error was caused by a failure to read or write bytes on an I/O
113114
/// stream.
114115
Io,
115116

@@ -134,8 +135,8 @@ pub enum Category {
134135
impl From<Error> for io::Error {
135136
/// Convert a `serde_json::Error` into an `io::Error`.
136137
///
137-
/// JSON syntax and data errors are turned into `InvalidData` IO errors.
138-
/// EOF errors are turned into `UnexpectedEof` IO errors.
138+
/// JSON syntax and data errors are turned into `InvalidData` I/O errors.
139+
/// EOF errors are turned into `UnexpectedEof` I/O errors.
139140
///
140141
/// ```
141142
/// use std::io;
@@ -182,7 +183,7 @@ pub(crate) enum ErrorCode {
182183
/// Catchall for syntax error messages
183184
Message(Box<str>),
184185

185-
/// Some IO error occurred while serializing or deserializing.
186+
/// Some I/O error occurred while serializing or deserializing.
186187
Io(io::Error),
187188

188189
/// EOF while parsing a list.

src/io/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum ErrorKind {
99
Other,
1010
}
1111

12-
// IO errors can never occur in no-std mode. All our no-std IO implementations
12+
// I/O errors can never occur in no-std mode. All our no-std I/O implementations
1313
// are infallible.
1414
pub struct Error;
1515

src/ser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ static ESCAPE: [u8; 256] = [
20622062
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, // F
20632063
];
20642064

2065-
/// Serialize the given data structure as JSON into the IO stream.
2065+
/// Serialize the given data structure as JSON into the I/O stream.
20662066
///
20672067
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.
20682068
///
@@ -2081,7 +2081,7 @@ where
20812081
value.serialize(&mut ser)
20822082
}
20832083

2084-
/// Serialize the given data structure as pretty-printed JSON into the IO
2084+
/// Serialize the given data structure as pretty-printed JSON into the I/O
20852085
/// stream.
20862086
///
20872087
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.

0 commit comments

Comments
 (0)