From 81bda7a9385adc3f3f885e297768492a96832646 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 3 Aug 2023 16:52:56 -0700 Subject: [PATCH] fix(nargo): Make dependencies section optional in TOML --- crates/nargo_cli/src/manifest.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/nargo_cli/src/manifest.rs b/crates/nargo_cli/src/manifest.rs index e1da57c0c2..0a17f62a7a 100644 --- a/crates/nargo_cli/src/manifest.rs +++ b/crates/nargo_cli/src/manifest.rs @@ -15,6 +15,7 @@ use crate::{errors::ManifestError, git::clone_git_repo}; #[derive(Debug, Deserialize, Clone)] struct PackageConfig { package: PackageMetadata, + #[serde(default)] dependencies: BTreeMap, } @@ -260,6 +261,19 @@ fn parse_standard_toml() { assert!(Config::try_from(src).is_ok()); } +#[test] +fn parse_package_toml_no_deps() { + let src = r#" + [package] + name = "test" + authors = ["kev", "foo"] + compiler_version = "0.1" + "#; + + assert!(Config::try_from(String::from(src)).is_ok()); + assert!(Config::try_from(src).is_ok()); +} + #[test] fn parse_workspace_toml() { let src = r#"