Skip to content

Commit 68bc7bb

Browse files
authored
Merge pull request #8316 from RenjiSann/fix-to-string
chore: fix more inefficient_to_string
2 parents 5808786 + 0183adf commit 68bc7bb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/uu/stty/src/stty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ fn stty(opts: &Options) -> UResult<()> {
247247
if let Some(args) = &opts.settings {
248248
let mut args_iter = args.iter();
249249
// iterate over args: skip to next arg if current one is a control char
250-
while let Some(arg) = args_iter.next() {
250+
while let Some(&arg) = args_iter.next() {
251251
// control char
252252
if let Some(char_index) = cc_to_index(arg) {
253253
if let Some(mapping) = args_iter.next() {
@@ -275,7 +275,7 @@ fn stty(opts: &Options) -> UResult<()> {
275275
));
276276
}
277277
// ispeed/ospeed baud rate setting
278-
} else if *arg == "ispeed" || *arg == "ospeed" {
278+
} else if arg == "ispeed" || arg == "ospeed" {
279279
match args_iter.next() {
280280
Some(speed) => {
281281
if let Some(baud_flag) = string_to_baud(speed) {
@@ -303,7 +303,7 @@ fn stty(opts: &Options) -> UResult<()> {
303303
));
304304
}
305305
}
306-
} else if *arg == "line" {
306+
} else if arg == "line" {
307307
match args_iter.next() {
308308
Some(line) => match parse_u8_or_err(line) {
309309
Ok(n) => valid_args.push(ArgOptions::Special(SpecialSetting::Line(n))),
@@ -319,7 +319,7 @@ fn stty(opts: &Options) -> UResult<()> {
319319
));
320320
}
321321
}
322-
} else if *arg == "min" {
322+
} else if arg == "min" {
323323
match args_iter.next() {
324324
Some(min) => match parse_u8_or_err(min) {
325325
Ok(n) => {
@@ -338,7 +338,7 @@ fn stty(opts: &Options) -> UResult<()> {
338338
));
339339
}
340340
}
341-
} else if *arg == "time" {
341+
} else if arg == "time" {
342342
match args_iter.next() {
343343
Some(time) => match parse_u8_or_err(time) {
344344
Ok(n) => valid_args
@@ -377,7 +377,7 @@ fn stty(opts: &Options) -> UResult<()> {
377377
));
378378
}
379379
valid_args.push(flag.into());
380-
} else if *arg == "rows" {
380+
} else if arg == "rows" {
381381
if let Some(rows) = args_iter.next() {
382382
if let Some(n) = parse_rows_cols(rows) {
383383
valid_args.push(ArgOptions::Special(SpecialSetting::Rows(n)));
@@ -399,7 +399,7 @@ fn stty(opts: &Options) -> UResult<()> {
399399
),
400400
));
401401
}
402-
} else if *arg == "columns" || *arg == "cols" {
402+
} else if arg == "columns" || arg == "cols" {
403403
if let Some(cols) = args_iter.next() {
404404
if let Some(n) = parse_rows_cols(cols) {
405405
valid_args.push(ArgOptions::Special(SpecialSetting::Cols(n)));
@@ -421,11 +421,11 @@ fn stty(opts: &Options) -> UResult<()> {
421421
),
422422
));
423423
}
424-
} else if *arg == "drain" {
424+
} else if arg == "drain" {
425425
set_arg = SetArg::TCSADRAIN;
426-
} else if *arg == "-drain" {
426+
} else if arg == "-drain" {
427427
set_arg = SetArg::TCSANOW;
428-
} else if *arg == "size" {
428+
} else if arg == "size" {
429429
valid_args.push(ArgOptions::Print(PrintSetting::Size));
430430
// not a valid option
431431
} else {

0 commit comments

Comments
 (0)