Skip to content

Commit 4a48d4d

Browse files
authored
Avoid extra string copy (#94)
1 parent ee0a82f commit 4a48d4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl UrlPatternInit {
214214
let baseurl_path = url::quirks::pathname(base_url);
215215
let slash_index = baseurl_path.rfind('/');
216216
if let Some(slash_index) = slash_index {
217-
let new_pathname = baseurl_path[..=slash_index].to_string();
217+
let new_pathname = &baseurl_path[..=slash_index];
218218
result.pathname =
219219
Some(format!("{}{}", new_pathname, result.pathname.unwrap()));
220220
}

0 commit comments

Comments
 (0)