Substitution::prefix -> subst_prefix

I probably want to get rid of this function completely later.
This commit is contained in:
Florian Diebold 2021-04-05 21:56:40 +02:00
parent 2a83645e1b
commit b67148daea
4 changed files with 15 additions and 11 deletions

View file

@ -75,10 +75,9 @@ pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
pub type FnSig = chalk_ir::FnSig<Interner>;
impl Substitution {
pub fn prefix(&self, n: usize) -> Substitution {
Substitution::intern(self.interned()[..std::cmp::min(self.len(&Interner), n)].into())
}
// FIXME: get rid of this
pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution {
Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into())
}
/// Return an index of a parameter in the generic type parameter list by it's id.