parser: replace manual strip with trim_start_matches (#29)

Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
This commit is contained in:
Maxim Zhukov 2020-11-03 13:26:14 +03:00 committed by GitHub
parent 9bb7583f30
commit e7b82b7079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,8 +267,5 @@ impl Parser {
fn ignore_bom(input: &str) -> &str {
const BOM: &str = "\u{feff}";
if input.starts_with(BOM) {
return &input[BOM.len()..];
}
input
input.trim_start_matches(BOM)
}