Skip to content

Commit

Permalink
Disable clippy::map_identity
Browse files Browse the repository at this point in the history
Summary:
See rust-lang/rust-clippy#11792

map_identity is causing build failures by taking its suggestion.

Once the fix is in, we can revert the changes to tools/buckconfigs/fbsource-common.bcfg in this diff.

Reviewed By: zertosh

Differential Revision: D53018763

fbshipit-source-id: a393dd9888a1320c19fc10de4b4c1e5d9b15bd43
  • Loading branch information
capickett authored and facebook-github-bot committed Jan 24, 2024
1 parent b9782c3 commit 3b4945d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions shed/sorted_vector_map/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,11 @@ where

/// Returns the first key-value pair in the map.
pub fn first_key_value(&self) -> Option<(&K, &V)> {
// Fixed by https://github.com/rust-lang/rust-clippy/pull/11792
#[allow(clippy::map_identity)]
self.0.first().map(|(k, v)| (k, v))
}

/// Returns the last key-value pair in the map.
pub fn last_key_value(&self) -> Option<(&K, &V)> {
// Fixed by https://github.com/rust-lang/rust-clippy/pull/11792
#[allow(clippy::map_identity)]
self.0.last().map(|(k, v)| (k, v))
}

Expand Down Expand Up @@ -541,8 +537,6 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {

#[inline]
fn next(&mut self) -> Option<Self::Item> {
// Fixed by https://github.com/rust-lang/rust-clippy/pull/11792
#[allow(clippy::map_identity)]
self.0.next().map(|(k, v)| (k, v))
}

Expand All @@ -561,8 +555,6 @@ impl<'a, K: 'a, V: 'a> ExactSizeIterator for Iter<'a, K, V> {
impl<'a, K: 'a, V: 'a> DoubleEndedIterator for Iter<'a, K, V> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
// Fixed by https://github.com/rust-lang/rust-clippy/pull/11792
#[allow(clippy::map_identity)]
self.0.next_back().map(|(k, v)| (k, v))
}
}
Expand Down

0 comments on commit 3b4945d

Please sign in to comment.