From 39c9b9c983414f746237c4f3b4d40c0e5c050d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E7=89=B9=E6=AF=8F=E7=BE=8A=E9=98=9F?= Date: Fri, 5 Jun 2026 23:00:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=20unwrap?= =?UTF-8?q?=20=E8=A7=A3=E5=8C=85=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_vm/src/coercion.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/oxide_vm/src/coercion.rs b/crates/oxide_vm/src/coercion.rs index f03200f..c000a12 100644 --- a/crates/oxide_vm/src/coercion.rs +++ b/crates/oxide_vm/src/coercion.rs @@ -64,7 +64,7 @@ pub fn to_string(vm: &Vm, val: JsValue) -> String { return "undefined".to_string(); } if val.is_string() { - return vm.lookup_str(val).unwrap_or("").to_string(); + return vm.lookup_str(val).unwrap_or_default(); } if val.is_object() { panic_to_object(); @@ -175,8 +175,8 @@ fn strict_double_eq(a: f64, b: f64) -> bool { pub fn relational_compare(vm: &Vm, lhs: JsValue, rhs: JsValue) -> Option { if lhs.is_string() && rhs.is_string() { - let ls = vm.lookup_str(lhs).unwrap_or(""); - let rs = vm.lookup_str(rhs).unwrap_or(""); + let ls = vm.lookup_str(lhs).unwrap_or_default(); + let rs = vm.lookup_str(rhs).unwrap_or_default(); return Some(ls < rs); } let l = to_number(lhs);