chore: 全仓 rustfmt 格式化归拢

This commit is contained in:
2026-08-16 12:50:36 +08:00
parent 648842fd82
commit fe8892079e
28 changed files with 166 additions and 247 deletions
+3 -3
View File
@@ -5,9 +5,9 @@
//! `compiled_module_hash` 纳入绑定名(精确匹配避免错误复用)。
use oxide_parser::{
ArrayExpressionElement, BindingPattern, ChainElement, Class, ClassElement, Declaration, ExportDefaultDeclarationKind,
Expression, ForStatementInit, ForStatementLeft, Function, ImportDeclarationSpecifier, ModuleExportName,
ObjectPropertyKind, PropertyKey, SimpleAssignmentTarget, Statement,
ArrayExpressionElement, BindingPattern, ChainElement, Class, ClassElement, Declaration,
ExportDefaultDeclarationKind, Expression, ForStatementInit, ForStatementLeft, Function, ImportDeclarationSpecifier,
ModuleExportName, ObjectPropertyKind, PropertyKey, SimpleAssignmentTarget, Statement,
};
use std::hash::Hash;
+1 -3
View File
@@ -193,9 +193,7 @@ fn hash_for_statement(fr: &oxide_parser::ForStatement<'_>, h: &mut rustc_hash::F
hash_statement(&fr.body, h, include_binding_names);
}
fn hash_function_declaration(
fd: &Function<'_>, h: &mut rustc_hash::FxHasher, include_binding_names: bool,
) {
fn hash_function_declaration(fd: &Function<'_>, h: &mut rustc_hash::FxHasher, include_binding_names: bool) {
if include_binding_names {
if let Some(id) = &fd.id {
id.name.as_str().hash(h);
@@ -60,7 +60,11 @@ fn await_yield_plain_distinguished() {
fn object_literals_distinguished() {
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { a: 2 }"));
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { b: 1 }"));
assert_ne!(compiled("var o = { a: 1 }"), compiled("var o = { a: 1, b: 2 }"), "property count must be hashed");
assert_ne!(
compiled("var o = { a: 1 }"),
compiled("var o = { a: 1, b: 2 }"),
"property count must be hashed"
);
}
#[test]