diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 19:40:57 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-30 15:04:43 -0800 |
| commit | 262c1efe6352a3e4dba4d8aebc4d9bd96849cd71 (patch) | |
| tree | 4096f26993c2db2e0c95181170ef63f46cf3cb7e /src/libstd/io | |
| parent | 023dfb0c898d851dee6ace2f8339b73b5287136b (diff) | |
| download | rust-262c1efe6352a3e4dba4d8aebc4d9bd96849cd71.tar.gz rust-262c1efe6352a3e4dba4d8aebc4d9bd96849cd71.zip | |
Register new snapshots
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/mod.rs | 41 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 20 |
2 files changed, 0 insertions, 61 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 7a25360e695..8d5b125bb08 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1017,8 +1017,6 @@ pub trait Writer { /// decide whether their stream needs to be buffered or not. fn flush(&mut self) -> IoResult<()> { Ok(()) } - // NOTE(stage0): Remove cfg after a snapshot - #[cfg(not(stage0))] /// Writes a formatted string into this writer, returning any error /// encountered. /// @@ -1057,45 +1055,6 @@ pub trait Writer { } - // NOTE(stage0): Remove method after a snapshot - #[cfg(stage0)] - /// Writes a formatted string into this writer, returning any error - /// encountered. - /// - /// This method is primarily used to interface with the `format_args!` - /// macro, but it is rare that this should explicitly be called. The - /// `write!` macro should be favored to invoke this method instead. - /// - /// # Errors - /// - /// This function will return any I/O error reported while formatting. - fn write_fmt(&mut self, fmt: &fmt::Arguments) -> IoResult<()> { - // Create a shim which translates a Writer to a FormatWriter and saves - // off I/O errors. instead of discarding them - struct Adaptor<'a, T:'a> { - inner: &'a mut T, - error: IoResult<()>, - } - - impl<'a, T: Writer> fmt::FormatWriter for Adaptor<'a, T> { - fn write(&mut self, bytes: &[u8]) -> fmt::Result { - match self.inner.write(bytes) { - Ok(()) => Ok(()), - Err(e) => { - self.error = Err(e); - Err(fmt::Error) - } - } - } - } - - let mut output = Adaptor { inner: self, error: Ok(()) }; - match fmt::write(&mut output, fmt) { - Ok(()) => Ok(()), - Err(..) => output.error - } - } - /// Write a rust string into this sink. /// /// The bytes written will be the UTF-8 encoded version of the input string. diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 6c8e4eea40f..43d2e078035 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -378,38 +378,18 @@ pub fn println(s: &str) { }) } -// NOTE(stage0): Remove cfg after a snapshot -#[cfg(not(stage0))] /// Similar to `print`, but takes a `fmt::Arguments` structure to be compatible /// with the `format_args!` macro. pub fn print_args(fmt: fmt::Arguments) { with_task_stdout(|io| write!(io, "{}", fmt)) } -// NOTE(stage0): Remove function after a snapshot -#[cfg(stage0)] -/// Similar to `print`, but takes a `fmt::Arguments` structure to be compatible -/// with the `format_args!` macro. -pub fn print_args(fmt: &fmt::Arguments) { - with_task_stdout(|io| write!(io, "{}", fmt)) -} - -// NOTE(stage0): Remove cfg after a snapshot -#[cfg(not(stage0))] /// Similar to `println`, but takes a `fmt::Arguments` structure to be /// compatible with the `format_args!` macro. pub fn println_args(fmt: fmt::Arguments) { with_task_stdout(|io| writeln!(io, "{}", fmt)) } -// NOTE(stage0): Remove function after a snapshot -#[cfg(stage0)] -/// Similar to `println`, but takes a `fmt::Arguments` structure to be -/// compatible with the `format_args!` macro. -pub fn println_args(fmt: &fmt::Arguments) { - with_task_stdout(|io| writeln!(io, "{}", fmt)) -} - /// Representation of a reader of a standard input stream pub struct StdReader { inner: StdSource |
