diff options
| author | Joel Höner <athre0z@zyantific.com> | 2021-03-07 16:22:53 +0100 |
|---|---|---|
| committer | Joel Höner <athre0z@zyantific.com> | 2021-03-07 16:22:53 +0100 |
| commit | ab8995bbca73be761402585ead491111163c44d6 (patch) | |
| tree | 64b3277dfd2bf2875137a98b9fc89528194d115f /library/std/src/io/impls.rs | |
| parent | 66ec64ccf31883cd2c28d045912a76179c0c6ed2 (diff) | |
| download | rust-ab8995bbca73be761402585ead491111163c44d6.tar.gz rust-ab8995bbca73be761402585ead491111163c44d6.zip | |
Generalize Write impl for Vec<u8> to Vec<u8, A>
As discussed in the issue tracker for the wg-allocators working group[1], updating this implementation for allocator support was most likely just forgotten in the original PR. [1]: https://github.com/rust-lang/wg-allocators/issues/86
Diffstat (limited to 'library/std/src/io/impls.rs')
| -rw-r--r-- | library/std/src/io/impls.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs index 00bf8b9af73..9870cfc4c95 100644 --- a/library/std/src/io/impls.rs +++ b/library/std/src/io/impls.rs @@ -1,6 +1,7 @@ #[cfg(test)] mod tests; +use crate::alloc::Allocator; use crate::cmp; use crate::fmt; use crate::io::{ @@ -357,7 +358,7 @@ impl Write for &mut [u8] { /// Write is implemented for `Vec<u8>` by appending to the vector. /// The vector will grow as needed. #[stable(feature = "rust1", since = "1.0.0")] -impl Write for Vec<u8> { +impl<A: Allocator> Write for Vec<u8, A> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.extend_from_slice(buf); |
