From 97082cf1c2f0ff5ebb4ded56c828fc621dda3259 Mon Sep 17 00:00:00 2001 From: amtoine Date: Mon, 15 Apr 2024 16:45:42 +0200 Subject: [PATCH] allow margin to be 0 --- src/config/mod.rs | 2 +- src/config/parsing.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index f2e598e..773c5aa 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -239,7 +239,7 @@ impl Config { } "margin" => { if let Some(val) = try_int(&value, &["margin"])? { - if val <= 0 { + if val < 0 { return Err(positive_integer(val, &["margin"], Span::unknown())); } config.margin = val as usize diff --git a/src/config/parsing.rs b/src/config/parsing.rs index 5500a08..b4ead85 100755 --- a/src/config/parsing.rs +++ b/src/config/parsing.rs @@ -70,7 +70,7 @@ fn u8_out_of_range(value: i64, cell_path: &[&str], span: Span) -> LabeledError { pub fn positive_integer(value: i64, cell_path: &[&str], span: Span) -> LabeledError { LabeledError::new("invalid config").with_label( format!( - "`$.{}` should be a strictly positive integer, found {}", + "`$.{}` should be a positive integer, found {}", cell_path.join("."), value ),