Skip to content

Commit

Permalink
add type alias
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jun 9, 2023
1 parent 18aaf2e commit b9acd48
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 105 deletions.
7 changes: 3 additions & 4 deletions source/forth3/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,7 @@ pub mod test {
use crate::{
dictionary::{BuiltinEntry, DictLocation, DictionaryBump, DictionaryEntry},
leakbox::{alloc_dict, LeakBox, LeakBoxDict},
vm::InterpretAction,
Error, Forth, Word,
Forth, ForthResult, Word,
};

#[cfg(feature = "async")]
Expand Down Expand Up @@ -773,7 +772,7 @@ pub mod test {

#[test]
fn allocs_work() {
fn stubby(_f: &mut Forth<()>) -> Result<InterpretAction, Error> {
fn stubby(_f: &mut Forth<()>) -> ForthResult {
panic!("Don't ACTUALLY call me!");
}

Expand All @@ -790,7 +789,7 @@ pub mod test {

#[test]
fn fork_onto_works() {
fn stubby(_f: &mut Forth<()>) -> Result<InterpretAction, Error> {
fn stubby(_f: &mut Forth<()>) -> ForthResult {
panic!("Don't ACTUALLY call me!");
}

Expand Down
8 changes: 4 additions & 4 deletions source/forth3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use dictionary::AsyncBuiltinEntry;

#[cfg(feature = "async")]
pub use crate::vm::AsyncForth;
pub use crate::vm::Forth;
pub use crate::vm::{Forth, ForthResult, InterpretAction};
use crate::{
dictionary::{BumpError, DictionaryEntry},
output::OutputError,
Expand Down Expand Up @@ -200,7 +200,7 @@ impl<T: 'static> CallContext<T> {
///
/// It takes the current "full context" (e.g. `Fif`), as well as the CFA pointer
/// to the dictionary entry.
type WordFunc<T> = fn(&mut Forth<T>) -> Result<vm::InterpretAction, Error>;
type WordFunc<T> = fn(&mut Forth<T>) -> ForthResult;

pub enum Lookup<T: 'static> {
Dict(DictLocation<T>),
Expand Down Expand Up @@ -257,7 +257,7 @@ pub mod test {
testutil::{all_runtest, blocking_runtest_with},
vm,
word::Word,
Error, Forth,
Error, Forth, ForthResult,
};

#[derive(Default)]
Expand Down Expand Up @@ -698,7 +698,7 @@ pub mod test {
}

impl<'forth> Future for CountingFut<'forth> {
type Output = Result<vm::InterpretAction, Error>;
type Output = ForthResult;

fn poll(
mut self: core::pin::Pin<&mut Self>,
Expand Down
4 changes: 2 additions & 2 deletions source/forth3/src/vm/async_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ where
&mut self.vm
}

pub async fn process_line(&mut self) -> Result<InterpretAction, Error> {
pub async fn process_line(&mut self) -> ForthResult {
let res = async {
loop {
match self.vm.start_processing_line()? {
Expand Down Expand Up @@ -215,7 +215,7 @@ where
}

// Single step execution (async version).
async fn async_pig(&mut self) -> Result<InterpretAction, Error> {
async fn async_pig(&mut self) -> ForthResult {
let Self {
ref mut vm,
ref builtins,
Expand Down
Loading

0 comments on commit b9acd48

Please sign in to comment.