Skip to content

Commit c7212ea

Browse files
committed
Renamed InvalidData to InvalidOutput
Following some bikeshedding on PR rust-lang#25246.
1 parent d650b0b commit c7212ea

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl fmt::Display for NulError {
238238
#[stable(feature = "rust1", since = "1.0.0")]
239239
impl From<NulError> for io::Error {
240240
fn from(_: NulError) -> io::Error {
241-
io::Error::new(io::ErrorKind::InvalidData,
241+
io::Error::new(io::ErrorKind::InvalidOutput,
242242
"data provided contains a nul byte")
243243
}
244244
}

src/libstd/io/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ pub enum ErrorKind {
9595
/// A parameter was incorrect.
9696
#[stable(feature = "rust1", since = "1.0.0")]
9797
InvalidInput,
98-
/// Invalid data encountered.
98+
/// The operation retrieved invalid data.
9999
#[stable(feature = "rust1", since = "1.0.0")]
100-
InvalidData,
100+
InvalidOutput,
101101
/// The I/O operation's timeout expired, causing it to be canceled.
102102
#[stable(feature = "rust1", since = "1.0.0")]
103103
TimedOut,

src/libstd/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn append_to_string<F>(buf: &mut String, f: F) -> Result<usize>
8181
let ret = f(g.s);
8282
if str::from_utf8(&g.s[g.len..]).is_err() {
8383
ret.and_then(|_| {
84-
Err(Error::new(ErrorKind::InvalidData,
84+
Err(Error::new(ErrorKind::InvalidOutput,
8585
"stream did not contain valid UTF-8"))
8686
})
8787
} else {

src/libstd/sys/windows/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ impl Output {
170170
}
171171

172172
fn invalid_encoding() -> io::Error {
173-
io::Error::new(io::ErrorKind::InvalidData, "text was not valid unicode")
173+
io::Error::new(io::ErrorKind::InvalidOutput, "text was not valid unicode")
174174
}

0 commit comments

Comments
 (0)