chore: cargo fmt

This commit is contained in:
2025-06-17 11:59:53 +08:00
parent 7f6848c9e5
commit 3e9f0a72a0
7 changed files with 65 additions and 38 deletions

View File

@@ -4,9 +4,9 @@ use std::rc::{Rc, Weak};
use ecow::EcoString;
use hashbrown::HashMap;
use crate::error::{Error, Result};
use crate::stack::Stack;
use crate::ty::internal::{EnvRef, Value};
use crate::error::{Error, Result};
#[derive(Clone)]
pub struct VmEnv {
@@ -63,7 +63,11 @@ impl VmEnv {
self.cache.last_mut().unwrap().insert(idx, val);
}
pub fn lookup_cache(&mut self, idx: usize, f: impl FnOnce(&mut VmEnv) -> Result<Value>) -> Result<Value> {
pub fn lookup_cache(
&mut self,
idx: usize,
f: impl FnOnce(&mut VmEnv) -> Result<Value>,
) -> Result<Value> {
for level in self.cache.iter().rev() {
if let Some(ret) = level.get(&idx) {
return ret.clone().ok();
@@ -87,7 +91,6 @@ impl VmEnv {
None
}
pub fn enter_arg(&mut self, arg: Value) {
self.args.push(arg)
}