Skip to content

Commit 25d6566

Browse files
committed
Fix clippy reported problems of single_char_pattern lint
This change fixes occurrences flagged by the clippy lint `single_char_pattern`. E.g., > warning: single-character string constant used as pattern > --> src/print.rs:6:29 > | > 6 | if self.0.ends_with("\n") { > | ^^^^ help: try using a char instead: `'\n'` > | > = help: for further information visit > https://rust-lang-nursery.github.io/rust-clippy/master/index.html#single_char_pattern
1 parent 77ae3b7 commit 25d6566

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'a, 'b> Context<'a, 'b> {
192192
loop {
193193
match self.iter.peek() {
194194
None => { break; }
195-
Some(arg) if arg.starts_with("-") => {
195+
Some(arg) if arg.starts_with('-') => {
196196
break;
197197
}
198198
Some(value) => {

src/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use action::{IFlagAction, ParseResult};
33

44
impl IFlagAction for Print {
55
fn parse_flag(&self) -> ParseResult {
6-
if self.0.ends_with("\n") {
6+
if self.0.ends_with('\n') {
77
print!("{}", self.0);
88
} else {
99
println!("{}", self.0);

0 commit comments

Comments
 (0)