summaryrefslogtreecommitdiff
path: root/cli/errors.rs
diff options
context:
space:
mode:
author林炳权 <695601626@qq.com>2023-10-06 02:49:09 +0800
committerGitHub <noreply@github.com>2023-10-05 14:49:09 -0400
commit7a01799f490739612be27725f1584a995f6b1491 (patch)
treef7861a6db6d055ed109281533786046ad44c4eb8 /cli/errors.rs
parentab3c9d41e483e5a7e6a326c66af7052a51301f91 (diff)
chore: update to Rust 1.73 (#20781)
Diffstat (limited to 'cli/errors.rs')
-rw-r--r--cli/errors.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/errors.rs b/cli/errors.rs
index 4ea0e000a..f867ebbcc 100644
--- a/cli/errors.rs
+++ b/cli/errors.rs
@@ -15,6 +15,7 @@ use deno_graph::ModuleError;
use deno_graph::ModuleGraphError;
use deno_graph::ResolutionError;
use import_map::ImportMapError;
+use std::fmt::Write;
fn get_import_map_error_class(_: &ImportMapError) -> &'static str {
"URIError"
@@ -70,7 +71,10 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str {
log::warn!(
"Error '{}' contains boxed error of unknown type:{}",
e,
- e.chain().map(|e| format!("\n {e:?}")).collect::<String>()
+ e.chain().fold(String::new(), |mut output, e| {
+ let _ = write!(output, "\n {e:?}");
+ output
+ })
);
}
"Error"