Skip to content

Commit 2316ca6

Browse files
committed
Remove AliasTy::type_parameters
1 parent 0abdef9 commit 2316ca6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

chalk-ir/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -840,15 +840,12 @@ impl<I: Interner> AliasTy<I> {
840840
Ty::new(interner, self)
841841
}
842842

843-
pub fn type_parameters<'a>(&'a self, interner: &'a I) -> impl Iterator<Item = Ty<I>> + 'a {
843+
pub fn self_type_parameter(&self, interner: &I) -> Ty<I> {
844844
self.substitution
845845
.iter(interner)
846-
.filter_map(move |p| p.ty(interner))
847-
.cloned()
848-
}
849-
850-
pub fn self_type_parameter(&self, interner: &I) -> Ty<I> {
851-
self.type_parameters(interner).next().unwrap()
846+
.find_map(move |p| p.ty(interner))
847+
.unwrap()
848+
.clone()
852849
}
853850
}
854851

0 commit comments

Comments
 (0)