Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit a6c0953

Browse files
committed
refactor(compiler): improve ident generate
1 parent d26e632 commit a6c0953

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/src/jsx.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ struct AlephJsxFold {
4747
impl AlephJsxFold {
4848
fn new_inline_style_ident(&mut self) -> String {
4949
let resolver = self.resolver.borrow();
50-
self.inline_style_idx = self.inline_style_idx + 1;
5150
let mut ident: String = "inline-style-".to_owned();
5251
let mut hasher = Sha1::new();
52+
self.inline_style_idx = self.inline_style_idx + 1;
5353
hasher.update(resolver.specifier.clone());
5454
hasher.update(self.inline_style_idx.to_string());
5555
ident.push_str(
5656
base64::encode(hasher.finalize())
57-
.replace("/", "")
5857
.replace("+", "")
59-
.as_str()
60-
.trim_end_matches('='),
58+
.replace("/", "")
59+
.replace("=", "")
60+
.as_str(),
6161
);
6262
ident
6363
}

compiler/src/resolve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ impl AlephResolveFold {
404404
hasher.update(callback_code.clone());
405405
ident.push_str(
406406
base64::encode(hasher.finalize())
407-
.replace("/", "")
408407
.replace("+", "")
409-
.as_str()
410-
.trim_end_matches('='),
408+
.replace("/", "")
409+
.replace("=", "")
410+
.as_str(),
411411
);
412412
ident
413413
}

0 commit comments

Comments
 (0)