From b0fe3d929f6f8764f371970b9f9ca9e7c415dafd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 3 Apr 2021 20:22:59 +0200 Subject: Add TyBuilder::unit() and TyExt::is_unit() --- crates/hir_ty/src/display.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/display.rs') diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 97f1092c6..eb82e1a11 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -19,7 +19,8 @@ use crate::{ db::HirDatabase, from_assoc_type_id, from_foreign_def_id, from_placeholder_idx, primitive, to_assoc_type_id, traits::chalk::from_chalk, utils::generics, AdtId, AliasEq, AliasTy, CallableDefId, CallableSig, DomainGoal, GenericArg, ImplTraitId, Interner, Lifetime, OpaqueTy, - ProjectionTy, QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TyKind, WhereClause, + ProjectionTy, QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TyExt, TyKind, + WhereClause, }; pub struct HirFormatter<'a> { @@ -423,7 +424,7 @@ impl HirDisplay for Ty { f.write_joined(sig.params(), ", ")?; write!(f, ")")?; let ret = sig.ret(); - if *ret != Ty::unit() { + if !ret.is_unit() { let ret_display = ret.into_displayable( f.db, f.max_size, @@ -663,7 +664,7 @@ impl HirDisplay for CallableSig { } write!(f, ")")?; let ret = self.ret(); - if *ret != Ty::unit() { + if !ret.is_unit() { let ret_display = ret.into_displayable(f.db, f.max_size, f.omit_verbose_types, f.display_target); write!(f, " -> {}", ret_display)?; -- cgit v1.2.3