Use a slightly more efficient .replace_range() instead of cloning the string twice
This commit is contained in:
parent
8646af6e9f
commit
7412d663e0
1 changed files with 2 additions and 4 deletions
|
@ -144,11 +144,9 @@ pub fn resolve_css_imports(
|
|||
});
|
||||
|
||||
let replacement = format!("\"{}\"", &content);
|
||||
let dest = link.name("to_repl").unwrap();
|
||||
|
||||
let t = resolved_css
|
||||
.replace(link.name("to_repl").unwrap().as_str(), &replacement)
|
||||
.to_string();
|
||||
resolved_css = t.clone();
|
||||
resolved_css.replace_range(dest.start()..dest.end(), &replacement);
|
||||
}
|
||||
|
||||
if as_dataurl {
|
||||
|
|
Loading…
Add table
Reference in a new issue