Avoided the redundant allocation.

Signed-off-by: FrankHB <frankhb1989@gmail.com>
This commit is contained in:
FrankHB 2020-09-29 18:01:06 +08:00
parent 65d9eb6f7e
commit 780fb979a0
1 changed files with 1 additions and 1 deletions

View File

@ -265,7 +265,7 @@ fn load_chapter<P: AsRef<Path>>(
})?;
if content.as_bytes().starts_with(b"\xef\xbb\xbf") {
content = content[3..].to_string()
content.replace_range(..3, "");
}
let stripped = location