Skip to content

Commit 789cb41

Browse files
llogiqbriansmith
authored andcommitted
Use characters instead of strings for single-character comparisons.
Found by Clippy.
1 parent c260b35 commit 789cb41

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ impl TestCase {
153153
/// empty (zero-length) value is represented as "".
154154
pub fn consume_bytes(&mut self, key: &str) -> Vec<u8> {
155155
let mut s = self.consume_string(key);
156-
if s.starts_with("\"") {
156+
if s.starts_with('\"') {
157157
// The value is a quoted strong.
158158
// XXX: We don't deal with any inner quotes.
159-
if !s.ends_with("\"") {
159+
if !s.ends_with('\"') {
160160
panic!("expected quoted string, found {}", s);
161161
}
162162
let _ = s.pop();
@@ -331,11 +331,11 @@ fn parse_test_case(current_section: &mut String,
331331
},
332332

333333
// Comments start with '#'; ignore them.
334-
Some(ref line) if line.starts_with("#") => { },
334+
Some(ref line) if line.starts_with('#') => { },
335335

336-
Some(ref line) if line.starts_with("[") => {
336+
Some(ref line) if line.starts_with('[') => {
337337
assert!(is_first_line);
338-
assert!(line.ends_with("]"));
338+
assert!(line.ends_with(']'));
339339
current_section.truncate(0);
340340
current_section.push_str(line);
341341
let _ = current_section.pop();

0 commit comments

Comments
 (0)