Skip to content

Commit 595d19e

Browse files
committed
rustc: replace a few .cloned() with .copied().
1 parent 4d81e9d commit 595d19e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/hir/map/definitions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl Definitions {
359359

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

365365
#[inline]
@@ -413,7 +413,7 @@ impl Definitions {
413413
#[inline]
414414
pub fn opt_span(&self, def_id: DefId) -> Option<Span> {
415415
if def_id.krate == LOCAL_CRATE {
416-
self.def_index_to_span.get(&def_id.index).cloned()
416+
self.def_index_to_span.get(&def_id.index).copied()
417417
} else {
418418
None
419419
}
@@ -525,7 +525,7 @@ impl Definitions {
525525
}
526526

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

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

0 commit comments

Comments
 (0)