Skip to content

Commit 8593485

Browse files
committed
fix clippy warnings from upgrade
1 parent ea61258 commit 8593485

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,15 +622,15 @@ impl PipeLineExpr {
622622
let n = match file.read(&mut buffer) {
623623
Ok(n) => n,
624624
Err(e) => {
625-
println!("{:?}", e);
625+
println!("{e:?}");
626626
return 1;
627627
}
628628
};
629629
if n == 0 {
630630
break;
631631
}
632632
if let Err(e) = stdin.write(&buffer[..n]) {
633-
panic!("Error writing to stdin: {}", e);
633+
panic!("Error writing to stdin: {e}");
634634
}
635635
}
636636
drop(stdin);
@@ -724,7 +724,7 @@ impl ExpansionExpr {
724724
}
725725
}
726726
ExpansionExpr::ParameterError(var, err) => {
727-
eprintln!("slush: {}: {}", var, err);
727+
eprintln!("slush: {var}: {err}");
728728
std::process::exit(1);
729729
}
730730
ExpansionExpr::ParameterAssign(var, default) => {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn repl() {
2828

2929
panic::set_hook(Box::new(|panic_info| {
3030
println!("one or more internal error occurred while running slush.");
31-
println!("{}", panic_info);
31+
println!("{panic_info}");
3232
println!("Submit an issue (or a pull request!) here: https://github.com/jacobmealey/slush");
3333
}));
3434

src/parser.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ impl Parser {
534534
self.next_token();
535535
if self.current_is(ShTokenType::EndOfFile) {
536536
return Err(format!(
537-
"Syntax Error: Unexpected end of file, no matching '{:?}'",
538-
right
537+
"Syntax Error: Unexpected end of file, no matching '{right:?}'"
539538
));
540539
}
541540
count += if self.current_is(left) {
@@ -558,8 +557,7 @@ impl Parser {
558557
while !self.try_consume(stop) {
559558
if self.current_is(ShTokenType::EndOfFile) {
560559
return Err(format!(
561-
"Syntax Error: Unexpected end of file, no matching '{:?}'",
562-
stop
560+
"Syntax Error: Unexpected end of file, no matching '{stop:?}'"
563561
));
564562
}
565563
ret.push_str(&self.current().lexeme);

src/parser/tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn tokens(st: &str) -> Result<Vec<Token>, String> {
109109
ret.push(it.next().unwrap());
110110
}
111111
if it.peek().is_none() {
112-
return Err(format!("Couldn't find second '{}'.", token));
112+
return Err(format!("Couldn't find second '{token}'."));
113113
}
114114
it.next();
115115
Ok(ret)

0 commit comments

Comments
 (0)