summaryrefslogtreecommitdiff
path: root/cli/tools/repl/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-08 22:45:06 -0400
committerGitHub <noreply@github.com>2024-05-08 22:45:06 -0400
commit47f7bed677a6b72e873712de8f3988ea891710e4 (patch)
tree096549459b479cf1383e65c87b77e9f9482df258 /cli/tools/repl/mod.rs
parente6dc4dfbff25e77d2127591802229b4a74037d24 (diff)
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
Diffstat (limited to 'cli/tools/repl/mod.rs')
-rw-r--r--cli/tools/repl/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs
index 8847bee52..c29e29e71 100644
--- a/cli/tools/repl/mod.rs
+++ b/cli/tools/repl/mod.rs
@@ -40,6 +40,7 @@ struct Repl {
message_handler: RustylineSyncMessageHandler,
}
+#[allow(clippy::print_stdout)]
impl Repl {
async fn run(&mut self) -> Result<(), AnyError> {
loop {
@@ -61,7 +62,7 @@ impl Repl {
break;
}
- println!("{output}");
+ println!("{}", output);
}
Err(ReadlineError::Interrupted) => {
if self.editor.should_exit_on_interrupt() {
@@ -75,7 +76,7 @@ impl Repl {
break;
}
Err(err) => {
- println!("Error: {err:?}");
+ println!("Error: {:?}", err);
break;
}
}
@@ -85,6 +86,7 @@ impl Repl {
}
}
+#[allow(clippy::print_stdout)]
async fn read_line_and_poll(
repl_session: &mut ReplSession,
message_handler: &mut RustylineSyncMessageHandler,
@@ -152,6 +154,7 @@ async fn read_eval_file(
Ok(file.into_text_decoded()?.source)
}
+#[allow(clippy::print_stdout)]
pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
let factory = CliFactory::from_flags(flags)?;
let cli_options = factory.cli_options();