remove needless result type in try_expand_term
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -108,7 +108,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusty-wam"
|
name = "rusty-wam"
|
||||||
version = "0.7.15"
|
version = "0.7.16"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"downcast 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ impl<'a, R: Read> TermStream<'a, R> {
|
|||||||
{
|
{
|
||||||
loop {
|
loop {
|
||||||
while let Some(term) = self.stack.pop() {
|
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) => {
|
Some(term_string) => {
|
||||||
let term = self.parse_expansion_output(term_string.as_str(), op_dir)?;
|
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 {
|
impl MachineState {
|
||||||
fn try_expand_term(&mut self, indices: &mut IndexStore, policies: &mut MachinePolicies,
|
fn try_expand_term(&mut self, indices: &mut IndexStore, policies: &mut MachinePolicies,
|
||||||
code_repo: &mut CodeRepo, term: &Term)
|
code_repo: &mut CodeRepo, term: &Term)
|
||||||
-> Result<Option<String>, ParserError>
|
-> Option<String>
|
||||||
{
|
{
|
||||||
let term_h = write_term_to_heap(term, self);
|
let term_h = write_term_to_heap(term, self);
|
||||||
let h = self.heap.h;
|
let h = self.heap.h;
|
||||||
@@ -122,7 +122,7 @@ impl MachineState {
|
|||||||
|
|
||||||
if self.fail {
|
if self.fail {
|
||||||
self.reset();
|
self.reset();
|
||||||
Ok(None)
|
None
|
||||||
} else {
|
} else {
|
||||||
let mut output = {
|
let mut output = {
|
||||||
let mut printer = HCPrinter::new(&self, PrinterOutputter::new());
|
let mut printer = HCPrinter::new(&self, PrinterOutputter::new());
|
||||||
@@ -136,7 +136,7 @@ impl MachineState {
|
|||||||
output.push_char('.');
|
output.push_char('.');
|
||||||
|
|
||||||
self.reset();
|
self.reset();
|
||||||
Ok(Some(output.result()))
|
Some(output.result())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user