knave 0.9.5

A small Lisp for humans and agents that infers types and ownership and compiles to readable Rust
Documentation
use std::path::PathBuf;

use super::exit_status::ExitStatus;
use super::terminal::Terminal;

pub struct TypesCommand {
    file: PathBuf,
}

impl TypesCommand {
    pub fn new(file: PathBuf) -> Self {
        Self { file }
    }

    pub fn run(self, terminal: &mut Terminal) -> ExitStatus {
        match terminal.check(&self.file) {
            Ok(program) => terminal.write_output(program.entry_signatures()),
            Err(status) => status,
        }
    }
}