use char instead of &str for single char patterns

This commit is contained in:
Matthias Krüger
2020-02-26 13:03:46 +01:00
parent a8437cf213
commit 7c84ba1124
30 changed files with 44 additions and 44 deletions

View File

@@ -19,7 +19,7 @@ fn extract_leading_metadata(s: &str) -> (Vec<&str>, &str) {
let mut count = 0;
for line in s.lines() {
if line.starts_with("# ") || line.starts_with("%") {
if line.starts_with("# ") || line.starts_with('%') {
// trim the whitespace after the symbol
metadata.push(line[1..].trim_start());
count += line.len() + 1;