Skip to content

Commit

Permalink
Import alloc types at top of unique_ptr module
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 30, 2024
1 parent 10bc5b1 commit 7b8c409
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/unique_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ use crate::fmt::display;
use crate::kind::Trivial;
use crate::string::CxxString;
use crate::ExternType;
#[cfg(feature = "std")]
use alloc::string::String;
#[cfg(feature = "std")]
use alloc::vec::Vec;
use core::ffi::c_void;
use core::fmt::{self, Debug, Display};
use core::marker::PhantomData;
Expand Down Expand Up @@ -198,12 +202,12 @@ where
}

#[inline]
fn read_to_end(&mut self, buf: &mut alloc::vec::Vec<u8>) -> io::Result<usize> {
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
self.pin_mut().read_to_end(buf)
}

#[inline]
fn read_to_string(&mut self, buf: &mut alloc::string::String) -> io::Result<usize> {
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
self.pin_mut().read_to_string(buf)
}

Expand Down

0 comments on commit 7b8c409

Please sign in to comment.