Skip to content

Commit 780fb97

Browse files
author
FrankHB
committed
Avoided the redundant allocation.
Signed-off-by: FrankHB <frankhb1989@gmail.com>
1 parent 65d9eb6 commit 780fb97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/book/book.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn load_chapter<P: AsRef<Path>>(
265265
})?;
266266

267267
if content.as_bytes().starts_with(b"\xef\xbb\xbf") {
268-
content = content[3..].to_string()
268+
content.replace_range(..3, "");
269269
}
270270

271271
let stripped = location

0 commit comments

Comments
 (0)