From 8998134906817211f2da3fc10679f9364a1c7d71 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 18 Apr 2024 20:12:23 +0200 Subject: [PATCH] chore(deps): bump ariadne to 0.4.0 (#7710) --- Cargo.lock | 4 ++-- crates/fmt/Cargo.toml | 2 +- crates/fmt/src/helpers.rs | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7dcd51e06731..17f662ae2a546 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -800,9 +800,9 @@ dependencies = [ [[package]] name = "ariadne" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72fe02fc62033df9ba41cba57ee19acf5e742511a140c7dbc3a873e19a19a1bd" +checksum = "dd002a6223f12c7a95cdd4b1cb3a0149d22d37f7a9ecdb2cb691a071fe236c29" dependencies = [ "unicode-width", "yansi 0.5.1", diff --git a/crates/fmt/Cargo.toml b/crates/fmt/Cargo.toml index 0f49a10a1b82e..c8937a281a5f3 100644 --- a/crates/fmt/Cargo.toml +++ b/crates/fmt/Cargo.toml @@ -14,7 +14,7 @@ foundry-config.workspace = true alloy-primitives.workspace = true -ariadne = "0.3" +ariadne = "0.4" itertools.workspace = true solang-parser.workspace = true thiserror = "1" diff --git a/crates/fmt/src/helpers.rs b/crates/fmt/src/helpers.rs index 8d472e3bb33be..9a31edeb0901b 100644 --- a/crates/fmt/src/helpers.rs +++ b/crates/fmt/src/helpers.rs @@ -81,6 +81,10 @@ pub fn print_diagnostics_report( path: Option<&Path>, diagnostics: Vec, ) -> std::io::Result<()> { + if diagnostics.is_empty() { + return Ok(()); + } + let filename = path.map(|p| p.file_name().unwrap().to_string_lossy().to_string()).unwrap_or_default(); for diag in diagnostics {