Skip to content

Commit

Permalink
rustc: replace a few .cloned() with .copied().
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Oct 25, 2019
1 parent 4d81e9d commit 595d19e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc/hir/map/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl Definitions {

#[inline]
pub fn opt_def_index(&self, node: ast::NodeId) -> Option<DefIndex> {
self.node_to_def_index.get(&node).cloned()
self.node_to_def_index.get(&node).copied()
}

#[inline]
Expand Down Expand Up @@ -413,7 +413,7 @@ impl Definitions {
#[inline]
pub fn opt_span(&self, def_id: DefId) -> Option<Span> {
if def_id.krate == LOCAL_CRATE {
self.def_index_to_span.get(&def_id.index).cloned()
self.def_index_to_span.get(&def_id.index).copied()
} else {
None
}
Expand Down Expand Up @@ -525,7 +525,7 @@ impl Definitions {
}

pub fn expansion_that_defined(&self, index: DefIndex) -> ExpnId {
self.expansions_that_defined.get(&index).cloned().unwrap_or(ExpnId::root())
self.expansions_that_defined.get(&index).copied().unwrap_or(ExpnId::root())
}

pub fn parent_module_of_macro_def(&self, expn_id: ExpnId) -> DefId {
Expand Down

0 comments on commit 595d19e

Please sign in to comment.