diff options
author | Jonas Schievink <[email protected]> | 2021-05-24 14:13:23 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-24 14:13:23 +0100 |
commit | 8ebb8d29e18d7cb18bd2b57b004dcecd65a96232 (patch) | |
tree | c50b52fe4c8ba204a924cc141544b7df4994edfb /crates/hir/src | |
parent | 05fc97e31b1d04bf5d5885edd98a1510f0931a62 (diff) |
internal: intern `TypeBound`s
Doesn't save much memory (~2 mb), but interning things is generally a
good pattern to follow
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/display.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 508ac37c2..c5cf803fd 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs | |||
@@ -92,7 +92,7 @@ impl HirDisplay for Function { | |||
92 | &data.ret_type | 92 | &data.ret_type |
93 | } else { | 93 | } else { |
94 | match &*data.ret_type { | 94 | match &*data.ret_type { |
95 | TypeRef::ImplTrait(bounds) => match &bounds[0] { | 95 | TypeRef::ImplTrait(bounds) => match bounds[0].as_ref() { |
96 | TypeBound::Path(path) => { | 96 | TypeBound::Path(path) => { |
97 | path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings | 97 | path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings |
98 | [0] | 98 | [0] |