Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c38c7b7

Browse files
committed
refactor(parser): Align check structure
1 parent 8d73f2b commit c38c7b7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

crates/toml/src/de/parser/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl<'i> State<'i> {
224224
return;
225225
};
226226
// "Likewise, using dotted keys to redefine tables already defined in [table] form is not allowed"
227-
let mixed_table_types = !dotted == parent_table.is_dotted();
227+
let mixed_table_types = dotted && !parent_table.is_dotted();
228228
if mixed_table_types {
229229
let key_span = get_key_span(&key);
230230
errors.report_error(ParseError::new("duplicate key").with_unexpected(key_span));

crates/toml_edit/src/parser/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl State {
307307
return;
308308
};
309309
// "Likewise, using dotted keys to redefine tables already defined in [table] form is not allowed"
310-
let mixed_table_types = !dotted == parent_table.is_dotted();
310+
let mixed_table_types = dotted && !parent_table.is_dotted();
311311
if mixed_table_types {
312312
let key_span = get_key_span(&key).expect("all keys have spans");
313313
errors.report_error(ParseError::new("duplicate key").with_unexpected(key_span));

0 commit comments

Comments
 (0)