Simplified the code, removed first_arg, the Option
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user