mirror of
https://github.com/danbulant/robotparser-rs
synced 2026-05-24 12:35:49 +00:00
parser: replace manual strip with trim_start_matches (#29)
Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
This commit is contained in:
parent
9bb7583f30
commit
e7b82b7079
1 changed files with 1 additions and 4 deletions
|
|
@ -267,8 +267,5 @@ impl Parser {
|
||||||
|
|
||||||
fn ignore_bom(input: &str) -> &str {
|
fn ignore_bom(input: &str) -> &str {
|
||||||
const BOM: &str = "\u{feff}";
|
const BOM: &str = "\u{feff}";
|
||||||
if input.starts_with(BOM) {
|
input.trim_start_matches(BOM)
|
||||||
return &input[BOM.len()..];
|
|
||||||
}
|
|
||||||
input
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue