Substitution::single -> from1

This commit is contained in:
Florian Diebold 2021-04-05 21:17:35 +02:00
parent 788533d380
commit 2f5a77658b
4 changed files with 17 additions and 14 deletions

View file

@ -31,7 +31,6 @@ mod test_db;
use std::sync::Arc;
use itertools::Itertools;
use smallvec::SmallVec;
use base_db::salsa;
use hir_def::{
@ -77,14 +76,6 @@ pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
pub type FnSig = chalk_ir::FnSig<Interner>;
impl Substitution {
pub fn single(ty: Ty) -> Substitution {
Substitution::intern({
let mut v = SmallVec::new();
v.push(ty.cast(&Interner));
v
})
}
pub fn prefix(&self, n: usize) -> Substitution {
Substitution::intern(self.interned()[..std::cmp::min(self.len(&Interner), n)].into())
}