Remove Constant::map_constant

This commit is contained in:
Jeong Yunwon committed 2022-05-16 04:50:54 +09:00
1 parent abe644bd72
commit b2c9b3ce90
2 files changed
+1 -8

No files matched your search

+1 -5
View File
@@ -47,10 +47,6 @@ pub trait Constant: Sized {
/// Transforms the given Constant to a BorrowedConstant
fn borrow_constant(&self) -> BorrowedConstant<Self>;
/// Map this Constant to a Bag's constant
fn map_constant<Bag: ConstantBag>(self, bag: &Bag) -> Bag::Constant {
bag.make_constant(self.borrow_constant())
}
/// Maps the name for the given Bag.
fn map_name<Bag: ConstantBag>(
@@ -765,7 +761,7 @@ impl<C: Constant> CodeObject<C> {
.constants
.into_vec()
.into_iter()
.map(|x| x.map_constant(bag))
.map(|x| bag.make_constant(x.borrow_constant()))
.collect(),
names: map_names(self.names),
varnames: map_names(self.varnames),
-3
View File
@@ -66,9 +66,6 @@ impl Constant for PyConstant {
fn borrow_constant(&self) -> BorrowedConstant<Self> {
borrow_obj_constant(&self.0)
}
fn map_constant<Bag: ConstantBag>(self, bag: &Bag) -> Bag::Constant {
bag.make_constant(self.borrow_constant())
}
}
pub(crate) struct PyObjBag<'a>(pub &'a Context);