From 5c2fc85807b7f39df535f159a4eee0f78aafa925 Mon Sep 17 00:00:00 2001 From: Tin Svagelj Date: Sat, 16 Sep 2023 20:50:55 +0200 Subject: [PATCH] Use all features for clippy Signed-off-by: Tin Svagelj --- .github/workflows/clippy.yml | 3 ++- src/refs.rs | 4 ++-- src/tracker.rs | 2 +- src/types.rs | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 7a82fd8..6f837d4 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -14,5 +14,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: rustup update nightly && rustup default nightly + - run: rustup component add clippy - name: Run clippy - run: cargo clippy + run: cargo clippy --all-features diff --git a/src/refs.rs b/src/refs.rs index de144b3..6120688 100644 --- a/src/refs.rs +++ b/src/refs.rs @@ -269,7 +269,7 @@ impl Clone for SyncContiguousEntryRef { SyncContiguousEntryRef { inner: self.inner.clone(), #[cfg(feature = "ptr_metadata")] - metadata: self.metadata.clone(), + metadata: self.metadata, #[cfg(not(feature = "ptr_metadata"))] _phantom: PhantomData, } @@ -500,7 +500,7 @@ impl Clone for ContiguousEntryRef { ContiguousEntryRef { inner: self.inner.clone(), #[cfg(feature = "ptr_metadata")] - metadata: self.metadata.clone(), + metadata: self.metadata, #[cfg(not(feature = "ptr_metadata"))] _phantom: PhantomData, } diff --git a/src/tracker.rs b/src/tracker.rs index f6d647e..d200e24 100644 --- a/src/tracker.rs +++ b/src/tracker.rs @@ -3,7 +3,7 @@ use core::{alloc::Layout, cmp::Ordering}; #[cfg(feature = "no_std")] -use crate::types::Vec; +use crate::types::{vec, Vec}; use crate::{error::ContiguousMemoryError, range::ByteRange}; /// A structure that keeps track of unused regions of memory within provided diff --git a/src/types.rs b/src/types.rs index 4bd1db6..73fbea9 100644 --- a/src/types.rs +++ b/src/types.rs @@ -22,6 +22,7 @@ mod nostd_imports { pub use alloc::alloc as allocator; + pub use ::alloc::vec; pub use ::alloc::vec::Vec; pub use ::alloc::rc::Rc;