Reduce clean::Type size by replacing a DefId (only used to check for display) with a boolean
This commit is contained in:
parent
e1ec3260d7
commit
4054c0f3e6
3 changed files with 31 additions and 18 deletions
|
@ -982,11 +982,7 @@ fn fmt_type<'cx>(
|
|||
write!(f, "impl {}", print_generic_bounds(bounds, cx))
|
||||
}
|
||||
}
|
||||
clean::QPath { ref assoc, ref self_type, ref trait_, ref self_def_id } => {
|
||||
let should_show_cast = !trait_.segments.is_empty()
|
||||
&& self_def_id
|
||||
.zip(Some(trait_.def_id()))
|
||||
.map_or(!self_type.is_self_type(), |(id, trait_)| id != trait_);
|
||||
clean::QPath { ref assoc, ref self_type, ref trait_, should_show_cast } => {
|
||||
if f.alternate() {
|
||||
if should_show_cast {
|
||||
write!(f, "<{:#} as {:#}>::", self_type.print(cx), trait_.print(cx))?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue