chore: cargo fmt

This commit is contained in:
2025-05-07 08:51:18 +08:00
parent 7261159e57
commit d41aa0fef2
8 changed files with 35 additions and 16 deletions

View File

@@ -41,7 +41,8 @@ impl Display for Symbol {
}
}
static REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"^[a-zA-Z\_][a-zA-Z0-9\_\'\-]*$"#).unwrap());
static REGEX: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r#"^[a-zA-Z\_][a-zA-Z0-9\_\'\-]*$"#).unwrap());
impl Symbol {
fn normal(&self) -> bool {
!REGEX.is_match(self)

View File

@@ -1,17 +1,17 @@
use std::cell::RefCell;
use std::sync::Arc;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use derive_more::{IsVariant, Unwrap};
use super::common::Catchable;
use super::common as c;
use super::common::Catchable;
use super::public as p;
use c::Symbol;
use crate::vm::{VM, Env};
use crate::bytecode::OpCodes;
use crate::vm::{Env, VM};
mod attrset;
mod cnst;
@@ -187,7 +187,7 @@ impl Value {
Catchable(_) => todo!(),
PrimOp(_) => "lambda",
PartialPrimOp(_) => "lambda",
Func(_) => "lambda"
Func(_) => "lambda",
}
}
@@ -380,7 +380,10 @@ impl Value {
)))));
*self = val;
} else {
*self = Value::Catchable(Catchable::new(Some(format!("cannot select from {:?}", self.typename()))))
*self = Value::Catchable(Catchable::new(Some(format!(
"cannot select from {:?}",
self.typename()
))))
}
self
}

View File

@@ -22,7 +22,7 @@ impl Debug for AttrSet {
match v {
List(_) => write!(f, "{k:?} = [ ... ]; ")?,
AttrSet(_) => write!(f, "{k:?} = {{ ... }}; ")?,
v => write!(f, "{k:?} = {v:?}; ")?
v => write!(f, "{k:?} = {v:?}; ")?,
}
}
write!(f, "}}")