Skip to content

Commit

Permalink
allow margin to be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Apr 15, 2024
1 parent acbf8d6 commit 97082cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/config/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down

0 comments on commit 97082cf

Please sign in to comment.