Skip to content

Commit

Permalink
Merge pull request #1371 from dtolnay/clippy
Browse files Browse the repository at this point in the history
Resolve std_instead_of_alloc clippy restriction
  • Loading branch information
dtolnay authored Aug 30, 2024
2 parents 69dc7c9 + 7b8c409 commit 86f1f71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
Expand Down
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 std::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 std::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 86f1f71

Please sign in to comment.