We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4373911 + fa00006 commit 77d5e83Copy full SHA for 77d5e83
src/parse.rs
@@ -75,8 +75,8 @@ fn remove_prefix(data: &'_ str) -> Result<&'_ str, ParseError> {
75
}
76
77
// check HC1: header
78
- if &data[0..4] != "HC1:" {
79
- return Err(ParseError::InvalidPrefix(String::from(&data[0..3])));
+ if !data.starts_with("HC1:") {
+ return Err(ParseError::InvalidPrefix(data.chars().take(4).collect()));
80
81
82
Ok(&data[4..])
0 commit comments