Simplified the code, removed first_arg, the Option

This commit is contained in:
notoria
2020-12-19 21:04:17 +01:00
parent 657e4f12bb
commit ec2c5a9b2c
3 changed files with 22 additions and 36 deletions

View File

@@ -332,13 +332,6 @@ pub enum PredicateClause {
}
impl PredicateClause {
pub fn first_arg(&self) -> Option<&Term> {
match self {
&PredicateClause::Fact(ref term, ..) => term.first_arg(),
&PredicateClause::Rule(ref rule, ..) => rule.head.1.first().map(|bt| bt.as_ref()),
}
}
// TODO: add this to `Term` in `prolog_parser` like `first_arg`.
pub fn args(&self) -> Option<&[Box<Term>]> {
match *self {