remove needless result type in try_expand_term

This commit is contained in:
Mark Thom
2018-12-02 15:17:45 -07:00
parent c281c1b427
commit deabdafa48
2 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -108,7 +108,7 @@ dependencies = [
[[package]]
name = "rusty-wam"
version = "0.7.15"
version = "0.7.16"
dependencies = [
"downcast 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -84,7 +84,7 @@ impl<'a, R: Read> TermStream<'a, R> {
{
loop {
while let Some(term) = self.stack.pop() {
match machine_st.try_expand_term(self.indices, self.policies, self.code_repo, &term)?
match machine_st.try_expand_term(self.indices, self.policies, self.code_repo, &term)
{
Some(term_string) => {
let term = self.parse_expansion_output(term_string.as_str(), op_dir)?;
@@ -106,7 +106,7 @@ impl<'a, R: Read> TermStream<'a, R> {
impl MachineState {
fn try_expand_term(&mut self, indices: &mut IndexStore, policies: &mut MachinePolicies,
code_repo: &mut CodeRepo, term: &Term)
-> Result<Option<String>, ParserError>
-> Option<String>
{
let term_h = write_term_to_heap(term, self);
let h = self.heap.h;
@@ -122,7 +122,7 @@ impl MachineState {
if self.fail {
self.reset();
Ok(None)
None
} else {
let mut output = {
let mut printer = HCPrinter::new(&self, PrinterOutputter::new());
@@ -136,7 +136,7 @@ impl MachineState {
output.push_char('.');
self.reset();
Ok(Some(output.result()))
Some(output.result())
}
}
}