internal: intern TypeBounds

Doesn't save much memory (~2 mb), but interning things is generally a
good pattern to follow
This commit is contained in:
Jonas Schievink 2021-05-24 15:13:23 +02:00
parent 05fc97e31b
commit 8ebb8d29e1
12 changed files with 49 additions and 27 deletions

View file

@ -92,7 +92,7 @@ impl HirDisplay for Function {
&data.ret_type
} else {
match &*data.ret_type {
TypeRef::ImplTrait(bounds) => match &bounds[0] {
TypeRef::ImplTrait(bounds) => match bounds[0].as_ref() {
TypeBound::Path(path) => {
path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings
[0]