summaryrefslogtreecommitdiff
path: root/cli/tools/repl
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/repl')
-rw-r--r--cli/tools/repl/editor.rs5
-rw-r--r--cli/tools/repl/mod.rs13
-rw-r--r--cli/tools/repl/session.rs5
3 files changed, 8 insertions, 15 deletions
diff --git a/cli/tools/repl/editor.rs b/cli/tools/repl/editor.rs
index f8302367a..c9f019305 100644
--- a/cli/tools/repl/editor.rs
+++ b/cli/tools/repl/editor.rs
@@ -277,8 +277,7 @@ fn validate(input: &str) -> ValidationResult {
| (Some(Token::DollarLBrace), Token::RBrace) => {}
(Some(left), _) => {
return ValidationResult::Invalid(Some(format!(
- "Mismatched pairs: {:?} is not properly closed",
- left
+ "Mismatched pairs: {left:?} is not properly closed"
)))
}
(None, _) => {
@@ -460,7 +459,7 @@ impl ReplEditor {
}
self.errored_on_history_save.store(true, Relaxed);
- eprintln!("Unable to save history file: {}", e);
+ eprintln!("Unable to save history file: {e}");
}
}
diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs
index 780f16a6a..a9cb0132b 100644
--- a/cli/tools/repl/mod.rs
+++ b/cli/tools/repl/mod.rs
@@ -112,14 +112,11 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
.await;
// only output errors
if let EvaluationOutput::Error(error_text) = output {
- println!(
- "Error in --eval-file file \"{}\": {}",
- eval_file, error_text
- );
+ println!("Error in --eval-file file \"{eval_file}\": {error_text}");
}
}
Err(e) => {
- println!("Error in --eval-file file \"{}\": {}", eval_file, e);
+ println!("Error in --eval-file file \"{eval_file}\": {e}");
}
}
}
@@ -129,7 +126,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
let output = repl_session.evaluate_line_and_get_output(&eval).await;
// only output errors
if let EvaluationOutput::Error(error_text) = output {
- println!("Error in --eval flag: {}", error_text);
+ println!("Error in --eval flag: {error_text}");
}
}
@@ -166,7 +163,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
break;
}
- println!("{}", output);
+ println!("{output}");
}
Err(ReadlineError::Interrupted) => {
if editor.should_exit_on_interrupt() {
@@ -180,7 +177,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
break;
}
Err(err) => {
- println!("Error: {:?}", err);
+ println!("Error: {err:?}");
break;
}
}
diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs
index cb7d18c46..e288ab0e6 100644
--- a/cli/tools/repl/session.rs
+++ b/cli/tools/repl/session.rs
@@ -419,10 +419,7 @@ impl ReplSession {
.text;
let value = self
- .evaluate_expression(&format!(
- "'use strict'; void 0;\n{}",
- transpiled_src
- ))
+ .evaluate_expression(&format!("'use strict'; void 0;\n{transpiled_src}"))
.await?;
Ok(TsEvaluateResponse {