Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace #[allow(unused_code)] with #[allow(dead_code)] in indexmap.rs #150

Merged
merged 3 commits into from
Jun 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/indexmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ mod vec {

/// Returns the contents of the vector as an array of length `M` if the length
/// of the vector is exactly `M`, otherwise returns `Err(self)`.
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn into_array<const M: usize>(self) -> Result<[T; M], Self> {
if self.len() == M {
// This is how the unstable `MaybeUninit::array_assume_init` method does it
Expand Down Expand Up @@ -329,7 +329,7 @@ mod vec {
/// new_len is less than len, the Vec is simply truncated.
///
/// See also [`resize_default`](struct.Vec.html#method.resize_default).
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()>
where
T: Clone,
Expand All @@ -356,7 +356,7 @@ mod vec {
/// If `new_len` is less than `len`, the `Vec` is simply truncated.
///
/// See also [`resize`](struct.Vec.html#method.resize).
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn resize_default(&mut self, new_len: usize) -> Result<(), ()>
where
T: Clone + Default,
Expand All @@ -382,7 +382,7 @@ mod vec {
/// - The elements at `old_len..new_len` must be initialized.
///
/// [`capacity()`]: #method.capacity
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) unsafe fn set_len(&mut self, new_len: usize) {
debug_assert!(new_len <= self.capacity());

Expand All @@ -398,7 +398,7 @@ mod vec {
/// # Panics
///
/// Panics if `index` is out of bounds.
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn swap_remove(&mut self, index: usize) -> T {
assert!(index < self.len);
unsafe { self.swap_remove_unchecked(index) }
Expand Down Expand Up @@ -439,7 +439,7 @@ mod vec {
///
/// Always returns `true` if `needle` is an empty slice.
#[inline]
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn starts_with(&self, needle: &[T]) -> bool
where
T: PartialEq,
Expand All @@ -452,7 +452,7 @@ mod vec {
///
/// Always returns `true` if `needle` is an empty slice.
#[inline]
#[allow(unused_code)]
#[allow(dead_code)]
pub(super) fn ends_with(&self, needle: &[T]) -> bool
where
T: PartialEq,
Expand Down