Skip to content

Commit

Permalink
more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-thomas committed Jan 9, 2025
1 parent f0618b4 commit 5f7b7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion titan-html/src/stylerule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ impl<'a> FromIterator<(&'a str, &'a str)> for StyleRule {
styles.hash(&mut hasher);
let key = hasher.finish();

let mut rule = String::from("r"); // CSS-rules cannot start with a number
let mut rule = String::with_capacity(64);
rule.push('r'); // CSS-rules cannot start with a number
rule.push_str(&utils::encode_base62(key));

Self { rule, styles }
Expand Down

0 comments on commit 5f7b7a3

Please sign in to comment.