[meta] Morph a few pub into pub(crate), and remove dead code;

This commit is contained in:
Benjamin Bouvier
2019-09-04 17:50:51 +02:00
parent 8fba449b7b
commit d1d2e790b9
21 changed files with 19 additions and 42 deletions

View File

@@ -11,7 +11,6 @@ use std::fmt;
pub enum Expr {
Var(VarIndex),
Literal(Literal),
Apply(Apply),
}
impl Expr {
@@ -39,7 +38,6 @@ impl Expr {
match self {
Expr::Var(var_index) => var_pool.get(*var_index).to_rust_code(),
Expr::Literal(literal) => literal.to_rust_code(),
Expr::Apply(a) => a.to_rust_code(var_pool),
}
}
}
@@ -81,9 +79,6 @@ impl DefPool {
pub fn get(&self, index: DefIndex) -> &Def {
self.pool.get(index).unwrap()
}
pub fn get_mut(&mut self, index: DefIndex) -> &mut Def {
self.pool.get_mut(index).unwrap()
}
pub fn next_index(&self) -> DefIndex {
self.pool.next_key()
}
@@ -430,16 +425,6 @@ impl Apply {
format!("{}({})", inst_name, args)
}
fn to_rust_code(&self, var_pool: &VarPool) -> String {
let args = self
.args
.iter()
.map(|arg| arg.to_rust_code(var_pool))
.collect::<Vec<_>>()
.join(", ");
format!("{}({})", self.inst.name, args)
}
pub fn inst_predicate(
&self,
format_registry: &FormatRegistry,