about summary refs log tree commit diff
path: root/library/std/src/io/buffered
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-27 08:13:47 +0100
committerGitHub <noreply@github.com>2024-11-27 08:13:47 +0100
commitdcebc5eddd4dccc444d68eae8d5d321d63d2c06f (patch)
tree8426e7689712ffaf7a2a451babd6e5d94cc47665 /library/std/src/io/buffered
parent21f6ef577ba8936d2e78c349e4062635818cbc6a (diff)
parentc14d137bfc5133f5a38fad2f58e30fed9c47ffe2 (diff)
downloadrust-dcebc5eddd4dccc444d68eae8d5d321d63d2c06f.tar.gz
rust-dcebc5eddd4dccc444d68eae8d5d321d63d2c06f.zip
Rollup merge of #133449 - joboet:io_const_error, r=tgross35
std: expose `const_io_error!` as `const_error!`

ACP: https://github.com/rust-lang/libs-team/issues/205
Tracking issue: https://github.com/rust-lang/rust/issues/133448

Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
Diffstat (limited to 'library/std/src/io/buffered')
-rw-r--r--library/std/src/io/buffered/bufreader/buffer.rs2
-rw-r--r--library/std/src/io/buffered/bufwriter.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/io/buffered/bufreader/buffer.rs b/library/std/src/io/buffered/bufreader/buffer.rs
index 52fe49985c6..17721090db5 100644
--- a/library/std/src/io/buffered/bufreader/buffer.rs
+++ b/library/std/src/io/buffered/bufreader/buffer.rs
@@ -41,7 +41,7 @@ impl Buffer {
         match Box::try_new_uninit_slice(capacity) {
             Ok(buf) => Ok(Self { buf, pos: 0, filled: 0, initialized: 0 }),
             Err(_) => {
-                Err(io::const_io_error!(ErrorKind::OutOfMemory, "failed to allocate read buffer"))
+                Err(io::const_error!(ErrorKind::OutOfMemory, "failed to allocate read buffer"))
             }
         }
     }
diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs
index c41bae2aa4e..574eb83dc56 100644
--- a/library/std/src/io/buffered/bufwriter.rs
+++ b/library/std/src/io/buffered/bufwriter.rs
@@ -96,7 +96,7 @@ impl<W: Write> BufWriter<W> {
 
     pub(crate) fn try_new_buffer() -> io::Result<Vec<u8>> {
         Vec::try_with_capacity(DEFAULT_BUF_SIZE).map_err(|_| {
-            io::const_io_error!(ErrorKind::OutOfMemory, "failed to allocate write buffer")
+            io::const_error!(ErrorKind::OutOfMemory, "failed to allocate write buffer")
         })
     }
 
@@ -238,7 +238,7 @@ impl<W: ?Sized + Write> BufWriter<W> {
 
             match r {
                 Ok(0) => {
-                    return Err(io::const_io_error!(
+                    return Err(io::const_error!(
                         ErrorKind::WriteZero,
                         "failed to write the buffered data",
                     ));