Skip to content

Commit

Permalink
Resolve std_instead_of_alloc clippy restriction
Browse files Browse the repository at this point in the history
    warning: used import from `std` instead of `alloc`
       --> src/unique_ptr.rs:201:41
        |
    201 |     fn read_to_end(&mut self, buf: &mut std::vec::Vec<u8>) -> io::Result<usize> {
        |                                         ^^^ help: consider importing the item from `alloc`: `alloc`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
    note: the lint level is defined here
       --> src/lib.rs:377:5
        |
    377 |     clippy::std_instead_of_alloc,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: used import from `std` instead of `alloc`
       --> src/unique_ptr.rs:206:44
        |
    206 |     fn read_to_string(&mut self, buf: &mut std::string::String) -> io::Result<usize> {
        |                                            ^^^ help: consider importing the item from `alloc`: `alloc`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
  • Loading branch information
dtolnay committed Aug 30, 2024
1 parent a191ad4 commit 10bc5b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unique_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ where
}

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

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

Expand Down

0 comments on commit 10bc5b1

Please sign in to comment.