summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrankHB <frankhb1989@gmail.com>2020-09-29 18:01:06 +0800
committerFrankHB <frankhb1989@gmail.com>2020-09-29 18:01:06 +0800
commit780fb979a0462feca19ba3bb6d0e3c1ccc7fe9dc (patch)
tree6f119a47a3968bb05a1c1dcf3c43e73b1e418279 /src
parent65d9eb6f7e01e298ed52db0c2fb2bd7a8b48ecbd (diff)
Avoided the redundant allocation.
Signed-off-by: FrankHB <frankhb1989@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/book/book.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/book/book.rs b/src/book/book.rs
index 369c6a07..09b51888 100644
--- a/src/book/book.rs
+++ b/src/book/book.rs
@@ -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