Skip to content

Commit

Permalink
Make SourceId derive Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Nov 25, 2018
1 parent ba175dc commit 9b22eb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/source/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lazy_static! {
}

/// Unique identifier for a source of packages.
#[derive(Clone, Eq, Debug)]
#[derive(Clone, Copy, Eq, Debug)]
pub struct SourceId {
inner: &'static SourceIdInner,
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/ops/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub fn resolve_with_previous<'a, 'cfg>(
//
// TODO: This seems like a hokey reason to single out the registry as being
// different
let mut to_avoid_sources = HashSet::new();
let mut to_avoid_sources: HashSet<&SourceId> = HashSet::new();
if let Some(to_avoid) = to_avoid {
to_avoid_sources.extend(
to_avoid
Expand All @@ -161,7 +161,7 @@ pub fn resolve_with_previous<'a, 'cfg>(
}

let keep = |p: &&'a PackageId| {
!to_avoid_sources.contains(&p.source_id()) && match to_avoid {
!to_avoid_sources.contains(p.source_id()) && match to_avoid {
Some(set) => !set.contains(p),
None => true,
}
Expand Down

0 comments on commit 9b22eb1

Please sign in to comment.