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

View file

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