diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-10-25 20:21:37 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-10-25 20:21:37 +0300 |
| commit | 595d19e6258f2bb6a8f36a1f6f1065ae52efb47e (patch) | |
| tree | 738bbcb411577c73ff7e1e00893ef3eb44aee312 | |
| parent | 4d81e9dd2ff873df9bb67da5c05d54b18d78b983 (diff) | |
rustc: replace a few `.cloned()` with `.copied()`.
| -rw-r--r-- | src/librustc/hir/map/definitions.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs index 40a51b92473..58e638e93ba 100644 --- a/src/librustc/hir/map/definitions.rs +++ b/src/librustc/hir/map/definitions.rs @@ -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] @@ -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 } @@ -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 { |
