Skip to content

Commit

Permalink
Minror cleanups from PR feedback
Browse files Browse the repository at this point in the history
This was also rebased in the meantime, this is the only new commit
since the rebase onto feat/dif-info.
  • Loading branch information
Floris Bruynooghe committed Dec 9, 2020
1 parent 0a39e49 commit 1585d05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,7 @@ pub enum ObjectUseInfo {

/// Newtype around a collection of [`ObjectCandidate`] structs.
///
/// This abstracts away some common operations needed on this collection. Because it needs
/// to be passed through objects implementing the [`CacheItemRequest`] trait while avoiding
/// copying and yet being able to mutate, we need to have inner mutability.
/// This abstracts away some common operations needed on this collection.
///
/// [`CacheItemRequest`]: ../actors/common/cache/trait.CacheItemRequest.html
#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)]
Expand Down
6 changes: 2 additions & 4 deletions src/types/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ impl ObjectUseInfo {

impl From<Vec<ObjectCandidate>> for AllObjectCandidates {
fn from(mut source: Vec<ObjectCandidate>) -> Self {
source.sort_by_key(|candidate| (candidate.source.clone(), candidate.location.clone()));
source
.sort_by_cached_key(|candidate| (candidate.source.clone(), candidate.location.clone()));
Self(source)
}
}
Expand All @@ -39,9 +40,6 @@ impl AllObjectCandidates {
Ok(index) => {
if let Some(mut candidate) = self.0.get_mut(index) {
candidate.debug = info;
} else {
// TODO(flub): remove before PR
panic!("wtf");
}
}
Err(_) => {
Expand Down

0 comments on commit 1585d05

Please sign in to comment.